@@ -6,7 +6,7 @@ var fs = require("fs");
6
6
7
7
var constants = require ( "./constants" ) ;
8
8
var utils = require ( "./utils/gen.utils" ) ;
9
- var native = require ( "./task_core/native" ) ;
9
+ var native = require ( "./task_core/native" ) ; //set db utils when we get them
10
10
var goose = require ( "./task_core/goose" ) ;
11
11
12
12
// general utility functions
@@ -54,6 +54,7 @@ var TaskProvider = function (_mongoose, _TaskMdl) {
54
54
TaskMdl = _TaskMdl ;
55
55
Roller = require ( "./roller" ) ( mongoose , _TaskMdl ) ;
56
56
dbUtils = require ( "./utils/db.utils" ) ( mongoose ) ;
57
+ native . setDbUtils ( dbUtils ) ;
57
58
modelCache = dbUtils . modelCache ;
58
59
setModel = dbUtils . setModel ;
59
60
getModel = dbUtils . getModel ;
@@ -406,7 +407,7 @@ function performFileSave(step, task, results) {
406
407
var options = step . options ? xcode ( step . options , true ) : { } ;
407
408
408
409
resolveFuture ( options , results ) ;
409
- options . _id = options . _id || utils . generateId ( ) ;
410
+ options . _id = options . _id || dbUtils . generateId ( ) ;
410
411
411
412
step . options = options ;
412
413
step . dataStore = [ { _id : options . _id } ] ;
@@ -488,7 +489,7 @@ function storeOldFile(task, step) {
488
489
if ( ! file ) return resolve ( false ) ;
489
490
490
491
var collection = task . constructor . collection ;
491
- step . dataStore = [ { removed : file . _id , shadow : utils . generateId ( ) } ] ;
492
+ step . dataStore = [ { removed : file . _id , shadow : dbUtils . generateId ( ) } ] ;
492
493
493
494
collection . updateOne ( { _id : task . _id } , task . toObject ( ) ) . then ( function ( ) {
494
495
var writeStream = gfs . createWriteStream ( {
0 commit comments