Is it possible to access the cloudflare bindings on the context in a scheduled task?
I have this in my
run
run
method:
async run() { const { DB } = useEvent().context.cloudflare.env const db = initializeDrizzle(DB) ...
async run() { const { DB } = useEvent().context.cloudflare.env const db = initializeDrizzle(DB) ...
But I get this error:
[nitro] Error while running scheduled task "db:resync" Nitro request context is not available. Note: This is an experimental feature and might be broken on non-Node.js environments.
[nitro] Error while running scheduled task "db:resync" Nitro request context is not available. Note: This is an experimental feature and might be broken on non-Node.js environments.
So my question is, is there a way to access my d1 as I need to pass the d1 which is on my cloudflare env to drizzle