diligent преди 5 години
родител
ревизия
fb36436270
променени са 1 файла, в които са добавени 2 реда и са изтрити 2 реда
  1. 2
    2
      app.js

+ 2
- 2
app.js Целия файл

} }
} }


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.`); console.log(`${_id} scraped.`);
return done(); return done();
} catch (err) { } catch (err) {
let collection = dbo.collection('scrapes'); let collection = dbo.collection('scrapes');


var o_id = new ObjectID(id); 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); await collection.updateOne({ _id: o_id }, newvalues);
agenda.now('scrape', { _id: o_id }); agenda.now('scrape', { _id: o_id });
return res.status(204).json(); return res.status(204).json();

Loading…
Отказ
Запис