2013-08-09 06:10:19 -04:00
|
|
|
{db, ObjectId} = require "./app/coffee/mongojs"
|
|
|
|
ConversionManager = require "./app/coffee/ConversionManager"
|
2013-08-09 06:36:19 -04:00
|
|
|
async = require "async"
|
2013-08-08 11:42:14 -04:00
|
|
|
|
2013-08-09 06:36:19 -04:00
|
|
|
db.docOps.find { }, { doc_id: true }, (error, docs) ->
|
|
|
|
throw error if error?
|
|
|
|
jobs = []
|
|
|
|
for doc in docs
|
|
|
|
do (doc) ->
|
|
|
|
jobs.push (callback) ->
|
|
|
|
doc_id = doc.doc_id.toString()
|
2013-08-09 08:27:35 -04:00
|
|
|
ConversionManager.convertOldRawUpdates doc_id, (error) ->
|
2013-08-09 06:36:19 -04:00
|
|
|
return callback(error) if error?
|
|
|
|
console.log doc_id, "DONE"
|
2013-08-09 08:54:30 -04:00
|
|
|
callback()
|
2013-08-09 06:36:19 -04:00
|
|
|
async.series jobs, (error) ->
|
2013-08-08 11:42:14 -04:00
|
|
|
throw error if error?
|
|
|
|
process.exit()
|
2013-08-09 06:10:19 -04:00
|
|
|
|
2013-08-08 11:42:14 -04:00
|
|
|
|