1.0.0-preview

This commit is contained in:
masnn committed 2020-05-13 12:25:18 +08:00
1 parent 90b06d6aa7
commit 8cd84f29e8
18 files changed
+152 -401

No files matched your search

+2 -2
View File
@@ -21,7 +21,7 @@ function del(_id) {
async function getFirst(query) {
const res = await coll.find(query).sort('_id', 1).limit(1).toArray();
if (res) {
if (res.length) {
await coll.deleteOne({ _id: res[0]._id });
return res[0];
}
@@ -35,6 +35,6 @@ async function consume(query, cb) {
}, 100);
}
module.exports = {
global.Hydro.model.task = module.exports = {
add, get, del, count, getFirst, consume,
};