[web2py] Re: web2py RESTful timeout

2015-01-05 Thread Dave S


On Sunday, January 4, 2015 9:04:21 PM UTC-8, Bart wrote:

 Adding exception handling inside my RESTful api fixed my problem. 
  Sometimes my RESTful posts contained corrupted data and this would cause 
 an exception and hang future posts. Adding try/except solved my issue.


It's always good to heard about forward progress!

/dps

-- 
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 the Google Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: web2py RESTful timeout

2015-01-05 Thread Bart
Adding exception handling inside my RESTful api fixed my problem. 
 Sometimes my RESTful posts contained corrupted data and this would cause 
an exception and hang future posts. Adding try/except solved my issue.

Thanks,
Bart

On Friday, November 21, 2014 8:36:36 AM UTC-7, Bart wrote:

 I have a python script that posts data to my web2py/application/projects 
 database using RESTful services.  Everything works fine for an hour or two, 
 but then all future posts will timeout.  If, using a web browser, I reload 
 the web2py application's main page then the RESTful services start working 
 again for another hour or two.  Any ideas why I cant run a script 24/7 to 
 GET/POST data to my web2py application's RESTful services? 


-- 
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 the Google Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: web2py RESTful timeout

2014-12-04 Thread Bart
This didn't fix my problem.  It worked for several days, but now I cant 
communicate to my server using RESTful services.  I'm sure if I load the 
website from a browser it will start working again.  This is very 
frustrating!  It sure seems like the RESTful service goes into some type of 
sleep mode.

On Wednesday, November 26, 2014 9:55:47 PM UTC-7, Bart wrote:

 Thanks I'm testing this now.  I'll let you know if it works.

 On Monday, November 24, 2014 10:04:56 AM UTC-7, Derek wrote:

 If you don't need sessions for those requests, you should disable 
 sessions first and see if that works better. Sessions kills concurrency.

 On Friday, November 21, 2014 8:36:36 AM UTC-7, Bart wrote:

 I have a python script that posts data to my web2py/application/projects 
 database using RESTful services.  Everything works fine for an hour or two, 
 but then all future posts will timeout.  If, using a web browser, I reload 
 the web2py application's main page then the RESTful services start working 
 again for another hour or two.  Any ideas why I cant run a script 24/7 to 
 GET/POST data to my web2py application's RESTful services? 



-- 
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 the Google Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: web2py RESTful timeout

2014-11-28 Thread Bart
Thanks I'm testing this now.  I'll let you know if it works.

On Monday, November 24, 2014 10:04:56 AM UTC-7, Derek wrote:

 If you don't need sessions for those requests, you should disable sessions 
 first and see if that works better. Sessions kills concurrency.

 On Friday, November 21, 2014 8:36:36 AM UTC-7, Bart wrote:

 I have a python script that posts data to my web2py/application/projects 
 database using RESTful services.  Everything works fine for an hour or two, 
 but then all future posts will timeout.  If, using a web browser, I reload 
 the web2py application's main page then the RESTful services start working 
 again for another hour or two.  Any ideas why I cant run a script 24/7 to 
 GET/POST data to my web2py application's RESTful services? 



-- 
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 the Google Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: web2py RESTful timeout

2014-11-28 Thread Bart
I'm using MySQL, but I've also used SQLite.  Yes I've verified that the 
POST is timing out.  I ran another test and the script ran for 2 days until 
the error showed up again.  I reloaded the default/index webpage in my 
browser and now its working again.  I'll try disabling sessions as Derek 
suggests.  Thanks.

On Monday, November 24, 2014 12:15:23 PM UTC-7, Leonel Câmara wrote:

 Are you sure it's the POSTs to web2py that are timing out and not the 
 fetching of the stock quotes?


-- 
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 the Google Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: web2py RESTful timeout

2014-11-24 Thread Derek
If you don't need sessions for those requests, you should disable sessions 
first and see if that works better. Sessions kills concurrency.

On Friday, November 21, 2014 8:36:36 AM UTC-7, Bart wrote:

 I have a python script that posts data to my web2py/application/projects 
 database using RESTful services.  Everything works fine for an hour or two, 
 but then all future posts will timeout.  If, using a web browser, I reload 
 the web2py application's main page then the RESTful services start working 
 again for another hour or two.  Any ideas why I cant run a script 24/7 to 
 GET/POST data to my web2py application's RESTful services? 


-- 
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 the Google Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: web2py RESTful timeout

2014-11-24 Thread Leonel Câmara
Are you sure it's the POSTs to web2py that are timing out and not the 
fetching of the stock quotes?

-- 
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 the Google Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] Re: web2py RESTful timeout

2014-11-23 Thread Michele Comitini
What db engine are you using?
Are you sure you have no web2py shells open lying around with a long
lasting transaction open?

2014-11-22 5:46 GMT+01:00 Bart bart.mcco...@gmail.com:

 My python script is getting a stock price from google finance and then
 posting (using RESTful api) to my web2py application every 15 minutes.
 When I look at the log files everything works for awhile, but after a
 couple hours every POST will timeout.  If I load the application's
 default/index page from a web browser then the RESTful POST works for
 another hour or two and then it times out again.  I've run the web2py
 server on pythonanywhere and on a local computer with the same results.

 r = requests.post(url, headers=headers, data=json.dumps(payload),
 timeout=360)

 def POST(table_name,**vars):
 if table_name == 'VEXMX':
 row = db(db.VEXMX.date==vars['date']).select().first()
 if row:
 result = {'exists':1, 'id':row.id, 'errors': {}}
 result = dict(result=result)
 else:
 result = dict(db.VEXMX.validate_and_insert(**vars))
 result['exists'] = 0
 result = dict(result=result)
 return result

 On Friday, November 21, 2014 3:55:31 PM UTC-7, Massimo Di Pierro wrote:

 We need more details. How often do you post? How long does it take to get
 a response?

 On Friday, 21 November 2014 09:36:36 UTC-6, Bart wrote:

 I have a python script that posts data to my web2py/application/projects
 database using RESTful services.  Everything works fine for an hour or two,
 but then all future posts will timeout.  If, using a web browser, I reload
 the web2py application's main page then the RESTful services start working
 again for another hour or two.  Any ideas why I cant run a script 24/7 to
 GET/POST data to my web2py application's RESTful services?

  --
 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 the Google Groups
 web2py-users group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to web2py+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/d/optout.


-- 
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 the Google Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: web2py RESTful timeout

2014-11-22 Thread Bart
My python script is getting a stock price from google finance and then 
posting (using RESTful api) to my web2py application every 15 minutes. 
 When I look at the log files everything works for awhile, but after a 
couple hours every POST will timeout.  If I load the application's 
default/index page from a web browser then the RESTful POST works for 
another hour or two and then it times out again.  I've run the web2py 
server on pythonanywhere and on a local computer with the same results.

r = requests.post(url, headers=headers, data=json.dumps(payload), 
timeout=360)

def POST(table_name,**vars):
if table_name == 'VEXMX':
row = db(db.VEXMX.date==vars['date']).select().first()
if row:
result = {'exists':1, 'id':row.id, 'errors': {}}
result = dict(result=result)
else:
result = dict(db.VEXMX.validate_and_insert(**vars))
result['exists'] = 0
result = dict(result=result)
return result

On Friday, November 21, 2014 3:55:31 PM UTC-7, Massimo Di Pierro wrote:

 We need more details. How often do you post? How long does it take to get 
 a response?

 On Friday, 21 November 2014 09:36:36 UTC-6, Bart wrote:

 I have a python script that posts data to my web2py/application/projects 
 database using RESTful services.  Everything works fine for an hour or two, 
 but then all future posts will timeout.  If, using a web browser, I reload 
 the web2py application's main page then the RESTful services start working 
 again for another hour or two.  Any ideas why I cant run a script 24/7 to 
 GET/POST data to my web2py application's RESTful services? 



-- 
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 the Google Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: web2py RESTful timeout

2014-11-21 Thread Massimo Di Pierro
We need more details. How often do you post? How long does it take to get a 
response?

On Friday, 21 November 2014 09:36:36 UTC-6, Bart wrote:

 I have a python script that posts data to my web2py/application/projects 
 database using RESTful services.  Everything works fine for an hour or two, 
 but then all future posts will timeout.  If, using a web browser, I reload 
 the web2py application's main page then the RESTful services start working 
 again for another hour or two.  Any ideas why I cant run a script 24/7 to 
 GET/POST data to my web2py application's RESTful services? 


-- 
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 the Google Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.