浏览代码

cleanup

master
diligent 4 年前
父节点
当前提交
fb36436270
共有 1 个文件被更改,包括 2 次插入2 次删除
  1. 2
    2
      app.js

+ 2
- 2
app.js 查看文件

@@ -51,7 +51,7 @@ agenda.define('scrape', async function (job, done) {
}
}

await collection.updateOne({ _id: _id }, { $set: { status: "done", result: properties } });
await collection.updateOne({ _id: _id }, { $set: { status: "done", result: properties, endDate: new Date() } });
console.log(`${_id} scraped.`);
return done();
} catch (err) {
@@ -201,7 +201,7 @@ app.patch("/scrapes/:id/execute", async (req, res) => {
let collection = dbo.collection('scrapes');

var o_id = new ObjectID(id);
var newvalues = { $set: { status: "pending" } };
var newvalues = { $set: { status: "pending", startDate: new Date() } };
await collection.updateOne({ _id: o_id }, newvalues);
agenda.now('scrape', { _id: o_id });
return res.status(204).json();

正在加载...
取消
保存