summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoreug-vs <eug-vs@keemail.me>2020-12-04 01:21:59 +0300
committereug-vs <eug-vs@keemail.me>2020-12-04 01:21:59 +0300
commit8ef929e503b00d93c5fee4ab996aeaa9abf283d3 (patch)
tree0aa142dce4a5d8dc4e90b090007cfbba3b4fc0fb
parenta79e87296271a2891594a1ab11d746fdd875c928 (diff)
downloadbsu-fantom-8ef929e503b00d93c5fee4ab996aeaa9abf283d3.tar.gz
chore: upgrade mongo-cronjob
-rw-r--r--package-lock.json18
-rw-r--r--package.json2
-rw-r--r--src/services/events/event.service.js1
-rw-r--r--src/services/events/models.js11
4 files changed, 12 insertions, 20 deletions
diff --git a/package-lock.json b/package-lock.json
index 046186f..80ced05 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -183,9 +183,9 @@
"integrity": "sha512-Jus9s4CDbqwocc5pOAnh8ShfrnMcPHuJYzVcSUU7lrh8Ni5HuIqX3oilL86p3dlTrk0LzHRCgA/GQ7uNCw6l2Q=="
},
"@types/mongodb": {
- "version": "3.5.34",
- "resolved": "https://registry.npmjs.org/@types/mongodb/-/mongodb-3.5.34.tgz",
- "integrity": "sha512-73iy3+MiH+wxSM+hVA5jcW9ZTUaor2WKvM7hW+htOSgVb7E6/JBHOWaxj7rL1/vaxEBziKRr/VPecy3YAKqLuQ==",
+ "version": "3.6.0",
+ "resolved": "https://registry.npmjs.org/@types/mongodb/-/mongodb-3.6.0.tgz",
+ "integrity": "sha512-5PGiTXS/tvvllyyD+LJt3bVyJixrY/ZIIJwsINnZorvJsN6gki4NH7Fhcep4MZF8HNCKNv2oWguysocS1jt9dw==",
"requires": {
"@types/bson": "*",
"@types/node": "*"
@@ -1056,9 +1056,9 @@
}
},
"mongo-cronjob": {
- "version": "0.1.1",
- "resolved": "https://registry.npmjs.org/mongo-cronjob/-/mongo-cronjob-0.1.1.tgz",
- "integrity": "sha512-fZe2kH53x6TAemoBVKOg7Ez96WtiB22l3bdi/sU02Dxtoom6cIbsH58RS/QVZ013LJR5IOYLm7QYXzyky5wJwA==",
+ "version": "0.1.2",
+ "resolved": "https://registry.npmjs.org/mongo-cronjob/-/mongo-cronjob-0.1.2.tgz",
+ "integrity": "sha512-WS5rpMXK0cJykRaNaHPRd2baK4Yl9+5vYVlmZjscaEPZqRKvL5CynA0yvfMlVOTdKHNgpQHN8T/wlO/fwtCXnw==",
"requires": {
"bluebird": "^3.7.2",
"cron": "^1.8.2",
@@ -1066,9 +1066,9 @@
},
"dependencies": {
"mongoose": {
- "version": "5.11.1",
- "resolved": "https://registry.npmjs.org/mongoose/-/mongoose-5.11.1.tgz",
- "integrity": "sha512-lP1lfYVNJzoFoR/gS3T+pZtvQiKKFAmUEhzpwjzDBn7ugPyAcYjOnBLHQMSt/MeQEcWqeoTE6hdSabiINjCxNw==",
+ "version": "5.11.3",
+ "resolved": "https://registry.npmjs.org/mongoose/-/mongoose-5.11.3.tgz",
+ "integrity": "sha512-qhL76i63E6YZ16uyrDFV39qh8Jyq1cserYgAOjdpFzOIKvxAQfAEx/UC+S9MYwQhwC3tbElN9G6WTZvtfC1q+g==",
"requires": {
"@types/mongodb": "^3.5.27",
"bson": "^1.1.4",
diff --git a/package.json b/package.json
index 8d9e300..0399ac1 100644
--- a/package.json
+++ b/package.json
@@ -18,7 +18,7 @@
"dotenv": "^8.2.0",
"feathers-mongoose": "^8.3.1",
"lodash": "^4.17.20",
- "mongo-cronjob": "^0.1.1",
+ "mongo-cronjob": "^0.1.2",
"mongoose": "^5.10.14",
"puppeteer": "^5.4.1"
}
diff --git a/src/services/events/event.service.js b/src/services/events/event.service.js
index 2a15c96..45aebd3 100644
--- a/src/services/events/event.service.js
+++ b/src/services/events/event.service.js
@@ -11,5 +11,6 @@ module.exports = app => {
const scheduler = new Scheduler(Model);
scheduler.registerHandler('class', handleAttendClassJob);
+ scheduler.registerHandler('test', handleTestJob);
};
diff --git a/src/services/events/models.js b/src/services/events/models.js
index 99dada1..72b10d7 100644
--- a/src/services/events/models.js
+++ b/src/services/events/models.js
@@ -1,16 +1,7 @@
const mongoose = require('mongoose');
const { Client } = require('mongo-cronjob');
-const { getConnection } = require('../../connectDb.js');
-
-const contextSchema = new mongoose.Schema({
- participants: [String],
- attendanceId: String,
- conferenceId: String
-});
-
-const connection = mongoose.connection;
-const client = new Client(connection, contextSchema);
+const client = new Client(mongoose.connection);
module.exports = client;