Change : - Path with your Own Path - Password with your Rocket Server Password Assuming you already had browser, python, web2py installed and set path variables Open Command Prompt (Start > Accessories > Command Prompt) Create new web2py app xcopy C:\web2py\applications\welcome C:\web2py\applications\test /s /e /h D Create Models notepad C:\web2py\applications\test\models\db_wizard_0.py db.define_table('asdf', Field('asdf'), auth.signature ) Create Scheduler notepad C:\web2py\applications\test\models\scheduler.py from gluon.scheduler import Scheduler def demo1(): db.asdf.insert(asdf = 'asdf') db.commit() mysched = Scheduler(db, tasks = dict(demo1 = demo1) ) Create Controllers notepad C:\web2py\applications\test\controllers\test.py def queue_task(): mysched.queue_task('demo1', prevent_drift = True, repeats = 0, period = 5) Run Web2py python C:\web2py\web2py.py -a password Open your Browser and go to "C:\Program Files\Mozilla Firefox\firefox.exe" http://127.0.0.1:8000/test/test/queue_task "C:\Program Files\Mozilla Firefox\firefox.exe" http://127.0.0.1:8000/test/appadmin/select/db?query=db.scheduler_task.id%3E0 Run scheduled tasks for the specified apps python C:\web2py\web2py.py -K test Open your Browser and go to "C:\Program Files\Mozilla Firefox\firefox.exe" http://127.0.0.1:8000/test/appadmin/select/db?query=db.scheduler_worker.id%3E0 "C:\Program Files\Mozilla Firefox\firefox.exe" http://127.0.0.1:8000/test/appadmin/select/db?query=db.scheduler_task.id%3E0 "C:\Program Files\Mozilla Firefox\firefox.exe" http://127.0.0.1:8000/test/appadmin/select/db?query=db.asdf.id%3E0
Comments (0)