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 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.