                 Results.addResult(user._id, problem._id, Submits.problemResult(user._id, problem))
     
     
-#SyncedCron.add
-#    name: 'loadTable',
-#    schedule: (parser) ->
-#        return parser.text('every 10 seconds');
-##        return parser.text('every 5 minutes');
-#    job: -> 
-#        (new BasicSubmitDownloader()).run()
+SyncedCron.add
+    name: 'loadTable',
+    schedule: (parser) ->
+        return parser.text('every 10 seconds');
+#        return parser.text('every 5 minutes');
+    job: -> 
+        (new UntilIgnoredSubmitDownloader()).run()
 
 SyncedCron.start()
 #Meteor.startup ->

        console.log uid, name, pid, runid, prob, date, "'"+outcome+"'"
        Submits.addSubmit(runid, date, uid, pid, outcome)
        Users.addUser(uid, name, "lic40")
        true
    
#    if date > endDate:  # we do not need this, but continue search
#        return True

            if not result
                break
            page = page + 1
        updateResults()
            
class LastSubmitDownloader extends AllSubmitDownloader
    needContinueFromSubmit: (runid) ->
        !Submits.findById(runid)

class UntilIgnoredSubmitDownloader extends AllSubmitDownloader
    needContinueFromSubmit: (runid) ->
        res = Submits.findById(runid)?.outcome
        r = !((res == "AC") || (res == "IG"))
        return r
            
            
updateResults = ->
    for user in Users.findAll().fetch()
