mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
remove bson & pandora support
This commit is contained in:
1 parent
31622bc580
commit
8051bb958b
23 files changed
+660
-170
No files matched your search
@@ -1,33 +0,0 @@
|
||||
class Cron {
|
||||
constructor() {
|
||||
this.tasks = [];
|
||||
}
|
||||
|
||||
plan(time, task) {
|
||||
const now = new Date();
|
||||
if (!(time instanceof Date)) time = new Date(time);
|
||||
this.tasks.push({
|
||||
id: setTimeout(() => {
|
||||
for (const i in this.tasks) {
|
||||
if (this.tasks[i].func === task) {
|
||||
this.tasks.splice(i, 1);
|
||||
break;
|
||||
}
|
||||
}
|
||||
task();
|
||||
}, time - now),
|
||||
func: task,
|
||||
});
|
||||
}
|
||||
|
||||
interval(time, task) {
|
||||
const now = new Date();
|
||||
if (!(time instanceof Date)) time = new Date(time);
|
||||
this.tasks.push({
|
||||
id: setTimeout(() => { task(); }, time - now),
|
||||
func: task,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = Cron;
|
||||
@@ -2,7 +2,7 @@ const assert = require('assert');
|
||||
const path = require('path');
|
||||
const os = require('os');
|
||||
const _ = require('lodash');
|
||||
const { ObjectID } = require('bson');
|
||||
const { ObjectID } = require('mongodb');
|
||||
const Koa = require('koa');
|
||||
const yaml = require('js-yaml');
|
||||
const morgan = require('koa-morgan');
|
||||
|
||||
Reference in new issue
Block a user