I got your point. It is that I made the whole project, its running
except for sending mails I need to run the mail_queue file manually , I
want it to run ever hour or so , so that the mails are being received.
so wanted to schedule the sending of mails once every hour and if the
load increases , I would have reduced the time.
but I am unable to get the scheduler to work for this :p
Is there a way a parallel task is called as soon as a mail is inserted
into the queue. it runs the file mail_queue but completes the request so
that user doesn't have to wait.
because right now it takes 5 seconds if I use mail.send for the request
to be completed. If I insert in the queue it complete the request in a
minute.
thanks,
regards,
Tushar Tuteja
PS: web2py is really great and easy to learn and you guys are providing
amazing support for this.
Me with my college mates at IIT Delhi (India) are actually promoting it
and we have a small community among ourselves now :)
On Thursday 17 October 2013 12:45 AM, Niphlod wrote:
the main point is not that is not inefficient by itself. It's just
that you need to make sure you don't use that in a model because in
web2py models are executed at **every** request, and you don't seem to
want to queue a task for every request that comes in :-P
On Wednesday, October 16, 2013 8:55:34 PM UTC+2, Tushar Tuteja wrote:
thanks a ton,
I ll try this and what would be appropriate place to insert the
file , so that it is not efficient.
thanks,
regards,
Tushar Tuteja
On 17 October 2013 00:22, Niphlod <nip...@gmail.com <javascript:>>
wrote:
the scheduler is running fine.
In the data you pasted here there's the reason why the
scheduler isn't picking up any new task.
times_run is 3 and repeats is set to 3, so the task got
executed 3 times already.
Sidenote: append a "return 1" to your function, so you'll get
scheduler_run records holding more details about the
executions, until you figure out the issues you're having on
what to choose when you queue the task.
Also, please do
sched = Scheduler(db, dict(fun=func))
sched.queue_task('func', uuid='test_insert', repeats=3, period=10)
without any worker running, so you can see what is inserted
into the scheduler_task table correctly.
Execute the sched.queue_task just one time only (if you put
that in models, it will be executed at every request and that
would be inefficient)
--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py
<http://github.com/web2py/web2py> (Source code)
- https://code.google.com/p/web2py/issues/list
<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/Zs7NODudXSE/unsubscribe
<https://groups.google.com/d/topic/web2py/Zs7NODudXSE/unsubscribe>.
To unsubscribe from this group and all its topics, send an
email to web2py+un...@googlegroups.com <javascript:>.
For more options, visit
https://groups.google.com/groups/opt_out
<https://groups.google.com/groups/opt_out>.
--
Tushar Tuteja
Undergraduate Student(Fourth Year)
Civil Engineering
IIT Delhi
+919953061943
ttu...@gmail.com <javascript:>
ce10...@civil.iitd.ernet.in <javascript:>
"The question isn't who is going to let me; its who is going to
stop me!" - Howard Roark
--
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/Zs7NODudXSE/unsubscribe.
To unsubscribe from this group and all its topics, send an email to
web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
--
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/groups/opt_out.