Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • cokoapps/server
  • jgutix/server
2 results
Show changes
Commits on Source (5)
......@@ -2,6 +2,14 @@
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
## [1.8.0](https://gitlab.coko.foundation/cokoapps/server/compare/v1.7.1...v1.8.0) (2020-12-09)
### Features
* **server:** add ability to turn off pg-boos job queue ([35a56f1](https://gitlab.coko.foundation/cokoapps/server/commit/35a56f1f81b4bf3c276595e7525ea7e6648ce305))
* **server:** add health check endpoint ([a03a4cb](https://gitlab.coko.foundation/cokoapps/server/commit/a03a4cb9c1cd1dce84949ed58011019acc08c3ca))
### [1.7.1](https://gitlab.coko.foundation/cokoapps/server/compare/v1.7.0...v1.7.1) (2020-12-08)
......
{
"name": "@coko/server",
"version": "1.7.1",
"version": "1.8.0",
"description": "A tweaked version of pubsweet-server for use by Coko's projects",
"main": "src/index.js",
"scripts": {
......
......@@ -19,6 +19,8 @@ const registerComponents = require('pubsweet-server/src/register-components')
const api = require('pubsweet-server/src/routes/api')
const index = require('pubsweet-server/src/routes/index')
const healthcheck = require('./healthcheck')
const configureApp = app => {
const models = require('@pubsweet/models')
const authsome = require('pubsweet-server/src/helpers/authsome')
......@@ -104,6 +106,8 @@ const configureApp = app => {
app.use('/api', api) // REST API
app.get('/healthcheck', healthcheck) // Server health endpoint
let useGraphQLServer = true
if (
config.has('pubsweet-server.useGraphQLServer') &&
......@@ -157,6 +161,14 @@ const configureApp = app => {
require(config.get('pubsweet-server.cron.path'))
}
let useJobQueue = true
if (
config.has('pubsweet-server.useJobQueue') &&
config.get('pubsweet-server.useJobQueue') === false
) {
useJobQueue = false
}
// Actions to perform when the HTTP server starts listening
app.onListen = async server => {
if (useGraphQLServer) {
......@@ -165,18 +177,20 @@ const configureApp = app => {
} = require('pubsweet-server/src/graphql/subscriptions')
addSubscriptions(server) // Add GraphQL subscriptions
}
const { startJobQueue } = require('pubsweet-server/src/jobs')
await startJobQueue() // Manage job queue
if (useJobQueue) {
const { startJobQueue } = require('pubsweet-server/src/jobs')
await startJobQueue() // Manage job queue
}
}
// Actions to perform when the server closes
app.onClose = async () => {
const { stopJobQueue } = require('pubsweet-server/src/jobs')
await stopJobQueue()
if (useJobQueue) {
const { stopJobQueue } = require('pubsweet-server/src/jobs')
await stopJobQueue()
}
return wait(500)
}
return app
}
......
const healthCheck = (req, res) => {
res.send({
uptime: process.uptime(),
message: 'Coolio',
timestamp: Date.now(),
})
}
module.exports = healthCheck
......@@ -6757,7 +6757,7 @@ promise-inflight@^1.0.1:
resolved "https://registry.yarnpkg.com/promise-inflight/-/promise-inflight-1.0.1.tgz#98472870bf228132fcbdd868129bad12c3c029e3"
integrity sha1-mEcocL8igTL8vdhoEputEsPAKeM=
"prompt@github:flatiron/prompt#1c95d1d8d333b5fbc13fa5f0619f3dcf0d514f87":
prompt@flatiron/prompt#1c95d1d8d333b5fbc13fa5f0619f3dcf0d514f87:
version "1.0.0"
resolved "https://codeload.github.com/flatiron/prompt/tar.gz/1c95d1d8d333b5fbc13fa5f0619f3dcf0d514f87"
dependencies:
......