Skip to content

Commit

Permalink
feat: remove cron
Browse files Browse the repository at this point in the history
现在只有一个0秒执行定时任务,不需要cron也能完成
  • Loading branch information
lovelyCARDINAL committed Oct 31, 2023
1 parent d551c08 commit 5bf7608
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 3,880 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -179,13 +179,10 @@ $(() => {
if (!window.LocalComments.dynamic) {
return;
}
// await mw.loader.using(["ext.gadget.cron"]);
Cron.CronJob.from({
cronTime: "0 * * * * *",
start: true,
onTick: () => {
formatTimestamp();
},
});
const secondsLeft = 60 - moment().seconds();
setTimeout(() => {
formatTimestamp();
setInterval(formatTimestamp(), 60 * 1000);
}, secondsLeft * 1000);
});
//</pre>
1 change: 0 additions & 1 deletion src/gadgets/CommentsinLocalTime/definition.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ peers: []
dependencies:
- ext.gadget.site-lib
- moment
- ext.gadget.cron

_sites:
- zh
Expand Down
2 changes: 0 additions & 2 deletions src/gadgets/cron/.eslintrc.yaml

This file was deleted.

Loading

0 comments on commit 5bf7608

Please sign in to comment.