while running this file, db is locked.
What to do in such case?
I find this answer:
if you can, use a separate db for the scheduler. SQLite doesn't handle well
concurrent writes (with default operational capabilities), so having the
scheduler operating on the same database of your "insertion" of messages
can lead to locks.
Just do
db = DAL('whatever.db')
db2 = DAL('whatever_scheduler.db')
db.define_table('messages', .....)
from gluon.scheduler import Scheduler
mysched = Scheduler(db2)
and to queue tasks you can then use
db2.scheduler_tasks.validate_and_insert(****)
or, with the new API
mysched.queue_task(***)
i'm not clear with it
Best,
Chetan Jain
On Thu, Jul 14, 2016 at 12:51 AM, Chetan Jain <[email protected]> wrote:
> is this the correct command to run : python web2py.py -S social -M -X -R
> applications/social/private/sms_queue.py?
>
> Best,
> Chetan Jain
>
> On Thu, Jul 14, 2016 at 12:43 AM, Dave S <[email protected]> wrote:
>
>>
>>
>> On Wednesday, July 13, 2016 at 12:03:31 PM UTC-7, Chetan Jain wrote:
>>>
>>> Finally, as described in Chapter 4, we need to run the mail_queue.py
>>> script as if it were inside a controller in our app:
>>>
>>> 1
>>>
>>> python web2py.py -S app -M -N -R applications/app/private/mail_queue.py
>>>
>>> where -S app tells web2py to run "mail_queue.py" as "app", -M tells
>>> web2py to execute models, and -N tells web2py not to run cron.
>>>
>>> For background task :
>>> http://web2py.com/books/default/chapter/34/08/email-and-sms#Sending-messages-using-a-background-task
>>> .
>>>
>>> I was simply following the command given in this document.
>>>
>>>
>>>
>>> Best,
>>> Chetan Jain
>>>
>>>
>> Hmmm, that must be an obsolete option, and that reference got missed when
>> the option was removed.
>>
>> /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 [email protected].
>> 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 [email protected].
For more options, visit https://groups.google.com/d/optout.