                      stdout.pipe(outStream)
 
       workers = myJobs.processJobs 'makeThumb', { concurrency: 2, prefetch: 2, pollInterval: 1000000000 }, worker
+
       myJobs.find({ type: 'makeThumb', status: 'ready' })
-             .observe
-               added: (doc) ->
-                  workers.trigger()
+         .observe
+            added: (doc) ->
+               workers.trigger()


      # Create a job to make a thumbnail for each newly uploaded image
      addedFileJob = (file) ->
         # Don't make new jobs for files tha already have them in process...
         # findAndModify is atomic, so in a multi-server environment,
         # only one server can succeed and go on to create a job
         myData.rawCollection().findAndModify(
            { _id: new MongoInternals.NpmModule.ObjectID(file._id.toHexString()), 'metadata._Job': {$exists: false}},
            [],

myData = new FileCollection('images', {
   resumable: true,     # Enable the resumable.js compatible chunked file upload interface
   http: [
      { method: 'get', path: '/id/:_id', lookup: (params, query) -> return { _id: params._id }}
   ]}
)

