Re: One-time tasks at varying times with Uwsgi Spooler

2015-07-31 Thread Javier Guerra Giraldez
On Fri, Jul 31, 2015 at 7:26 PM, thinkwell  wrote:
> a_long_task.spool({'hello':'world', 'at':timedelta(hours=5))


the 'at' parameter should be _outside_ the callable dictionay, and it
must be the unix timestamp, not a timedelta:

a_long_task.spool({'hello':'world'},
at=(datetime.now()+timedelta(hours=5).timestamp())

-- 
Javier

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAFkDaoRb1atmAYFafHBrPC%2BNYdVO0T%2BY%2Bf5v3tHZ821PVXG5Ow%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


One-time tasks at varying times with Uwsgi Spooler

2015-07-31 Thread thinkwell


I'm using django-uwsgi 
 in my 
application, but I'm needing to run asynchronous tasks (one-time only) in 
my django app at varying times, based on user input. 


I tried passing in at "at" key to a_long_task.spool({'hello':'world', 
'at':timedelta(hours=5)), but that raises a 

ValueErrror: *spooler callable dictionary must contains only bytes*


So I guess that means I can only decorate the task instead of its 
instantiation. Is there some other suggestion to enable me pass in a 
variable time param when the spooled tasked should run?


TIA!

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/2cb64244-2177-42bc-ad56-0a7f8eda8616%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.