Created
May 7, 2012 17:28
-
-
Save iwein/2629126 to your computer and use it in GitHub Desktop.
Iron.io scheduler
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from iron_worker import * | |
//you could read this from a file or stdin if you're not too lazy | |
payload = {'herokuping':{'hosts': ['comma-separated-hosts.com', 'another.net']}} | |
worker = IronWorker(config='config.ini') | |
name = "heroku-pinger" | |
zipFile = IronWorker.createZip(files=["herokuping_worker.py"], | |
destination="herokuping_worker.zip", overwrite=True) | |
ret = worker.postCode(name=name, runFilename="herokuping_worker.py", | |
zipFilename="herokuping_worker.zip") | |
print str(ret) | |
ret = worker.postSchedule(name=name, | |
delay=10, run_every=900, run_times=300000, | |
payload=payload) | |
print "postTask returned: %s" % ret |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment