On Tuesday, February 6, 2018 at 12:10:18 PM UTC-8, Andrea Fae' wrote:
>
> I created like in the book. It's a model. I'm scheduling from the database 
> administrative interface. 2 days ago worked perfectly! I don't know!
>
>
I've never tried that.  The production system I run the scheduler on 
doesn't have a GUI to run a browser from, and I don't often set up SSL port 
forwarding to run appadmin from my client system.  I schedule either 
through a web page (exposed controller function) or through using -S on the 
command line (non-exposed controller function.

See
<URL:https://github.com/web2py/web2py-book/blob/master/sources/29-web2py-english/13.markmin#L942>

(The online copy of the book hasn't been synched with github for a while, 
it seems, so I can't point you at a pretty copy.)

/dps

 

> Il 06 feb 2018 9:05 PM, "Dave S" <[email protected] <javascript:>> ha 
> scritto:
>
>>
>>
>> On Tuesday, February 6, 2018 at 7:58:15 AM UTC-8, Andrea Fae' wrote:
>>>
>>> Hello, days ago I started to use scheduler and all was working very 
>>> well. I could see db.scheduler_run.task_id lines in the db with all the 
>>> results and console.
>>>
>>> Now the scheduler works very well but I don't see nothing in the 
>>> table db.scheduler_run.task_id. Why? Talk completed without problems...
>>>
>>
>> I don't know.  My scheduler_run rows all show a task_id.  I have more 
>> than 2500 runs since switching to 2.15.4 (minimum of 3 runs a day).  I had 
>> 1900+ runs under 2.14.6.
>>
>>
>>> This is my routine (from the moment I tried to use AppConfig - now is 
>>> commented - I noted no lines in the table above...)
>>>
>>>
>> Where does this code live?  In a model file, a module, or ??
>>
>> How do you schedule it?
>>
>>  
>>
>>> def chiusura_automatica_ticket():
>>>     esito = False
>>>     # questa è la data odierna
>>>     todate = datetime.date.today()
>>>     # print 'todate = ', todate
>>>     
>>>     # carico da appconfig.ini il numero di giorni lavorativi in cui lo 
>>> scehdulature chiude in automatico le richieste di intervento
>>>     # mycustom_conf = AppConfig()
>>>     # questo è il delta in giorni lavorativi indietro
>>>     # giorni_da_apertura = 
>>> mycustom_conf.get('custom.automatic_ticket_closing')
>>>     giorni_da_apertura = 30
>>>     print giorni_da_apertura
>>>     
>>>     # questa è la data di partenza
>>>     fromdate = date_by_subtract_business_days(todate,giorni_da_apertura)
>>>     # print 'fromdate = ',fromdate
>>>
>>>     # seleziono i ticket prima della data "fromdate" che non siano 
>>> ancora chiusi
>>>     query = (db.ticket.created_on < fromdate) & (db.ticket.chiuso == 
>>> False)
>>>     db(query).update(chiuso = True, risoluzione = 'CHIUSO 
>>> AUTOMATICAMENTE')
>>>     # commit necessaria
>>>     esito = db.commit()
>>>     return esito
>>>
>>
>>
>> /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 a topic in the 
>> Google Groups "web2py-users" group.
>> To unsubscribe from this topic, visit 
>> https://groups.google.com/d/topic/web2py/Xjtf3rRBZyU/unsubscribe.
>> To unsubscribe from this group and all its topics, send an email to 
>> [email protected] <javascript:>.
>> 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.

Reply via email to