Skip to content

Commit

Permalink
feat: fix jobs
Browse files Browse the repository at this point in the history
  • Loading branch information
catouberos committed Dec 24, 2023
1 parent a2009c4 commit db0ee0e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 11 deletions.
11 changes: 1 addition & 10 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { Logtail } from "@logtail/edge";

import { runRegistriesCheck } from "./jobs/ppdvn";
import { runKDCCheck } from "./jobs/kimdong";

export interface Env {
MAYOI_KV: KVNamespace;
Expand All @@ -25,20 +24,12 @@ export default {
const baseLogger = new Logtail(env.LOGTAIL_TOKEN);
const logger = baseLogger.withExecutionContext(ctx);

if (event.cron === "0 5-17/12 * * *") {
if (event.cron === "5 */1 * * *") {
try {
await runRegistriesCheck(env, logger);
} catch (err: any) {
logger.error("DKXB error occurred!", err);
}
}

if (event.cron === "0 */6 * * *") {
try {
await runKDCCheck(env, logger);
} catch (err: any) {
logger.error("Kim Dong Comics error occurred!", err);
}
}
},
};
2 changes: 1 addition & 1 deletion wrangler.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ kv_namespaces = [
# Docs: https://developers.cloudflare.com/workers/platform/triggers/cron-triggers/
# Configuration: https://developers.cloudflare.com/workers/wrangler/configuration/#triggers
[triggers]
crons = ["0 */6 * * *", "0 5-17/12 * * *"]
crons = ["5 */1 * * *"]

0 comments on commit db0ee0e

Please sign in to comment.