Scheduler always QUEUED in windows

174 views
Skip to first unread message

narges Rezaei

unread,
Apr 2, 2016, 5:04:19 AM4/2/16
to web2py-users
hi 
i have an application  for send sms in certain time . i use pycharm (web2py) for writing this program and  web2py scheduler . i can see the records of tasks in db.scheduler_task but no records in scheduler_run and scheduler_worker tables and also the task will execute befor insert in table .


Here is part of my codes in default.py:
def index():
 t=mysched.queue_task( demo() ,start_time=request.now+ timed(seconds=60) )
 q=mysched.task_status(t.id , output=True)

and the code in scheduler.py in Models folder:

from gluon.scheduler import Scheduler
import time

def demo():
    #send sms in start time
    return None

mysched = Scheduler(db,  max_empty_runs=10 , discard_results=False)
######################

Could any one help me figure out the problem?
Thanks!  

Dave S

unread,
Apr 2, 2016, 5:23:37 AM4/2/16
to web2py-users
Did you start the scheduler with "python web2py.py --regularoptionsgoheer -K" ?

You can do this from the command line for a manual start.  For automatic restart after a boot, you need to put in the appropriate system script.

/ps
 

narges Rezaei

unread,
Apr 2, 2016, 8:25:35 AM4/2/16
to web2py-users
i did not use it , i use "http://127.0.0.1:8000/myapplication" .

Dave S

unread,
Apr 3, 2016, 12:38:03 AM4/3/16
to web2py-users


On Saturday, April 2, 2016 at 5:25:35 AM UTC-7, narges Rezaei wrote:
i did not use it , i use "http://127.0.0.1:8000/myapplication" .


That is a URL.  One typically enters that in a browser address  box.

How do you start the web2py server so that it responds to URLs?   What is your environment?

/dps

narges Rezaei

unread,
Apr 3, 2016, 12:44:53 AM4/3/16
to web...@googlegroups.com
i use PyCharm for writing program and when it run ,web2py server will start . i work in windows. 
i open pycharm and create a web2py project.
thanks.

--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
---
You received this message because you are subscribed to a topic in the Google Groups "web2py-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/web2py/sQL_0uu71gA/unsubscribe.
To unsubscribe from this group and all its topics, send an email to web2py+un...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Dave S

unread,
Apr 3, 2016, 1:16:33 AM4/3/16
to web2py-users
On Saturday, April 2, 2016 at 9:44:53 PM UTC-7, narges Rezaei wrote:
i use PyCharm for writing program and when it run ,web2py server will start . i work in windows. 
i open pycharm and create a web2py project.
thanks.


Open a cmd.exe window ("DOS window"), and use the cd command to get to the directory where web2py.exe is.
For me, that is 
cd C:\Users\Dave\web2py_win\web2py_win-2141B


start web2py as a normal server however you prefer (from the command line, or from your IDE)

You can then enter the command 

web2py -i 0.0.0.0 -K MyApp

(I don't have a scheduler use on my Windows machine, so this command complains about no attribute '_scheduler'.  Where I use the scheduler happens to be a linux machine, for reasons outside of web2py)

On Windows, I start my web2py instance from the command line, and it throws up a small GUI panel.  There's a menu item there for Scheduler, but it doesn't do anything for me, probably because I don't have an app here using the scheduler.

/dps

narges Rezaei

unread,
Apr 3, 2016, 1:28:41 AM4/3/16
to web...@googlegroups.com
thanks a lot .
I did it , the project folder should be in "web2py" folder . my project was in pycharm folder . after then , i did "cd C:\Users\narges\web2py"  and then start the web2py server with IDE  and then  "web2py.exe  -K MyApp" in cmd.


To unsubscribe from this group and all its topics, send an email to web2py+unsubscribe@googlegroups.com.

Dave S

unread,
Apr 4, 2016, 2:21:58 AM4/4/16
to web2py-users
On Saturday, April 2, 2016 at 10:28:41 PM UTC-7, narges Rezaei wrote:
thanks a lot .
I did it , the project folder should be in "web2py" folder . my project was in pycharm folder . after then , i did "cd C:\Users\narges\web2py"  and then start the web2py server with IDE  and then  "web2py.exe  -K MyApp" in cmd.


Good news!
Reply all
Reply to author
Forward
0 new messages