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...
This is my routine (from the moment I tried to use AppConfig - now is commented - I noted no lines in the table above...)
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