Skip to content

Commit

Permalink
better fixing of idle time
Browse files Browse the repository at this point in the history
  • Loading branch information
mizzao committed Aug 14, 2014
1 parent 9175989 commit 44a394a
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions server/scripts.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -284,17 +284,20 @@ Meteor.methods
console.log "#{paidWorkers} workers compensated"
return

"cm-fix-asst-idle": (asstId, instanceId) ->
"cm-fix-asst-idle": (asstId, instanceId, idleMillis) ->
TurkServer.checkAdmin()
check(asstId, String)
check(instanceId, String)

modifier = if idleMillis?
$set: { "instances.$.idleTime": idleMillis }
else
$unset: { "instances.$.idleTime": null }

Assignments.update {
_id: asstId,
"instances.id": instanceId
}, {
$unset: { "instances.$.idleTime": null }
}
}, modifier

return

Expand Down

0 comments on commit 44a394a

Please sign in to comment.