 source = process.argv[2]
 DOCUMENT_PACK_DELAY = Number(process.argv[3]) || 1000
 TIMEOUT = Number(process.argv[4]) || 30*60*1000
+COUNT = 0  # number processed
+TOTAL = 0  # total number to process
 
 if !source.match(/^[0-9]+$/)
 	file = fs.readFileSync source

	db.close () ->
		logger.log 'closing LockManager Redis Connection'
		LockManager.close () ->
			logger.log 'ready to exit from pack archive worker'
			hardTimeout = setTimeout () ->
				logger.error 'hard exit from pack archive worker'
				process.exit(1)

processUpdates = (pending) ->
	async.eachSeries pending,	(result, callback) ->
		{_id, project_id, doc_id} = result
		COUNT++
		logger.log {project_id, doc_id}, "processing #{COUNT}/#{TOTAL}"
		if not project_id? or not doc_id?
			logger.log {project_id, doc_id}, "skipping pack, missing project/doc id"
			return callback()
