Skip to content

Commit

Permalink
fix: rss crontab exception (#265)
Browse files Browse the repository at this point in the history
  • Loading branch information
OXeu authored Oct 6, 2024
1 parent aacc105 commit 404c4a9
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
"dev": "turbo dev",
"dev:client": "bun --filter './client' dev",
"dev:server": "bun wrangler dev --port 11498",
"dev:cron": "bun wrangler dev --port 11498 --test-scheduled",
"check": "turbo check",
"cf-deploy": "bun scripts/migrator.ts",
"b": "turbo build",
Expand Down
11 changes: 11 additions & 0 deletions server/src/_worker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,17 @@ export default {
env: Env,
ctx: ExecutionContext
) {
const db = drizzle(env.DB, { schema: schema })
Container.set(envToken, env)
Container.set(dbToken, db)

const exist = Container.has("cache")
if (!exist) {
Container.set("cache", new CacheImpl());
Container.set("server.config", new CacheImpl("server.config"));
Container.set("client.config", new CacheImpl("client.config"));
}

await friendCrontab(env, ctx)
await rssCrontab(env)
},
Expand Down

0 comments on commit 404c4a9

Please sign in to comment.