mirror of https://gitee.com/bigwinds/arangodb
handle missing frontend collection
This commit is contained in:
parent
8a0d51241d
commit
7eb577b8cc
|
@ -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({
|
||||
|
|
Loading…
Reference in New Issue