1
0
Fork 0

handle missing frontend collection

This commit is contained in:
jsteemann 2018-10-11 11:54:29 +02:00
parent 8a0d51241d
commit 7eb577b8cc
1 changed files with 11 additions and 1 deletions

View File

@ -363,7 +363,17 @@ authRouter.post('/graph-examples/create/:name', function (req, res) {
`);
authRouter.post('/job', function (req, res) {
db._frontend.save(Object.assign(req.body, {model: 'job'}));
let frontend = db._collection('_frontend');
if (!frontend) {
frontend = db._create('_frontend', {
isSystem: true,
waitForSync: false,
journalSize: 1024 * 1024,
replicationFactor: internal.DEFAULT_REPLICATION_FACTOR_SYSTEM,
distributeShardsLike: '_graphs'
});
}
frontend.save(Object.assign(req.body, {model: 'job'}));
res.json(true);
})
.body(joi.object({