Add config for objectId size (#3950)

* Add objectId config property, default to 10

* Update Config constructor

* Add test for backwards compatibility when changing objectId size
This commit is contained in:
Steven Shipton
2017-06-27 11:22:43 +01:00
committed by Natan Rolnik
parent bd6816c14c
commit 51d2dd92cb
9 changed files with 64 additions and 8 deletions

View File

@@ -52,7 +52,7 @@ function statusHandler(className, database) {
export function jobStatusHandler(config) {
let jobStatus;
const objectId = newObjectId();
const objectId = newObjectId(config.objectIdSize);
const database = config.database;
const handler = statusHandler(JOB_STATUS_COLLECTION, database);
const setRunning = function(jobName, params) {
@@ -103,7 +103,7 @@ export function jobStatusHandler(config) {
});
}
export function pushStatusHandler(config, objectId = newObjectId()) {
export function pushStatusHandler(config, objectId = newObjectId(config.objectIdSize)) {
let pushStatus;
const database = config.database;