Skip to content
Snippets Groups Projects
Commit dcd352ad authored by Yannis Barlas's avatar Yannis Barlas
Browse files

feat(server): add cron support

parent 5dffd0fb
No related branches found
No related tags found
No related merge requests found
......@@ -35,6 +35,7 @@
"http-status-codes": "^1.4.0",
"lodash": "^4.17.15",
"morgan": "^1.10.0",
"node-cron": "^2.0.3",
"passport": "^0.4.1",
"pubsweet-server": "^13.9.4",
"waait": "^1.0.5"
......
......@@ -103,6 +103,11 @@ const configureApp = app => {
.json({ message: err.message })
})
if (config.has('pubsweet-server.cron.path')) {
/* eslint-disable-next-line import/no-dynamic-require */
require(config.get('pubsweet-server.cron.path'))
}
// Actions to perform when the HTTP server starts listening
app.onListen = async server => {
const {
......
const cron = require('node-cron')
const authentication = require('pubsweet-server/src/authentication')
const app = require('./app')
......@@ -6,5 +8,6 @@ const createJWT = authentication.token.create
module.exports = {
app,
cron,
createJWT,
}
......@@ -4131,6 +4131,14 @@ nocache@2.1.0:
resolved "https://registry.yarnpkg.com/nocache/-/nocache-2.1.0.tgz#120c9ffec43b5729b1d5de88cd71aa75a0ba491f"
integrity sha512-0L9FvHG3nfnnmaEQPjT9xhfN4ISk0A8/2j4M37Np4mcDesJjHgEUfgPhdCyZuFI954tjokaIj/A3NdpFNdEh4Q==
node-cron@^2.0.3:
version "2.0.3"
resolved "https://registry.yarnpkg.com/node-cron/-/node-cron-2.0.3.tgz#b9649784d0d6c00758410eef22fa54a10e3f602d"
integrity sha512-eJI+QitXlwcgiZwNNSRbqsjeZMp5shyajMR81RZCqeW0ZDEj4zU9tpd4nTh/1JsBiKbF8d08FCewiipDmVIYjg==
dependencies:
opencollective-postinstall "^2.0.0"
tz-offset "0.0.1"
node-fetch@^2.1.2, node-fetch@^2.2.0:
version "2.6.0"
resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.6.0.tgz#e633456386d4aa55863f676a7ab0daa8fdecb0fd"
......@@ -4307,7 +4315,7 @@ onetime@^5.1.0:
dependencies:
mimic-fn "^2.1.0"
opencollective-postinstall@^2.0.2:
opencollective-postinstall@^2.0.0, opencollective-postinstall@^2.0.2:
version "2.0.2"
resolved "https://registry.yarnpkg.com/opencollective-postinstall/-/opencollective-postinstall-2.0.2.tgz#5657f1bede69b6e33a45939b061eb53d3c6c3a89"
integrity sha512-pVOEP16TrAO2/fjej1IdOyupJY8KDUM1CvsaScRbw6oddvpQoOfGk4ywha0HKKVAD6RkW4x6Q+tNBwhf3Bgpuw==
......@@ -5757,6 +5765,11 @@ typedarray@^0.0.6:
resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777"
integrity sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c=
tz-offset@0.0.1:
version "0.0.1"
resolved "https://registry.yarnpkg.com/tz-offset/-/tz-offset-0.0.1.tgz#fef920257024d3583ed9072a767721a18bdb8a76"
integrity sha512-kMBmblijHJXyOpKzgDhKx9INYU4u4E1RPMB0HqmKSgWG8vEcf3exEfLh4FFfzd3xdQOw9EuIy/cP0akY6rHopQ==
uglify-js@^3.1.4:
version "3.8.0"
resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-3.8.0.tgz#f3541ae97b2f048d7e7e3aa4f39fd8a1f5d7a805"
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment