remove bson & pandora support

This commit is contained in:
undefined committed 2020-07-02 12:32:55 +08:00
1 parent 31622bc580
commit 8051bb958b
23 files changed
+660 -170

No files matched your search

-33
View File
@@ -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;
+1 -1
View File
@@ -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');