Release room-scoped Matrix bot plugins and room configuration
This commit is contained in:
commit
86c7e4359c
76 files changed
+13539
No files matched your search
@@ -0,0 +1,11 @@
|
||||
import { CronJob } from 'cron';
|
||||
|
||||
export interface Scheduler {
|
||||
register(cron: string, timeZone: string, run: () => Promise<void>): () => void;
|
||||
}
|
||||
export class PluginScheduler implements Scheduler {
|
||||
register(cron: string, timeZone: string, run: () => Promise<void>): () => void {
|
||||
const job = new CronJob(cron, () => { void run().catch(() => undefined); }, null, true, timeZone);
|
||||
return () => job.stop();
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user