Browse Source

Rotina de verificação de serviços como cronjob

pull/159/head 3.0.1
Sesostris Vieira 2 years ago
parent
commit
d305332c23
  1. 0
      sigi/apps/servicos/jobs/__init__.py
  2. 0
      sigi/apps/servicos/jobs/daily/__init__.py
  3. 20
      sigi/apps/servicos/jobs/daily/atualiza_uso_servicos.py
  4. 0
      sigi/apps/servicos/jobs/hourly/__init__.py
  5. 0
      sigi/apps/servicos/jobs/monthly/__init__.py
  6. 0
      sigi/apps/servicos/jobs/weekly/__init__.py
  7. 0
      sigi/apps/servicos/jobs/yearly/__init__.py

0
sigi/apps/servicos/jobs/__init__.py

0
sigi/apps/servicos/jobs/daily/__init__.py

20
sigi/apps/servicos/jobs/daily/atualiza_uso_servicos.py

@ -0,0 +1,20 @@
import datetime
from django_extensions.management.jobs import DailyJob
from sigi.apps.servicos.models import Servico
class Job(DailyJob):
help = "Atualiza uso dos serviços"
def execute(self):
print(
"Atualizando uso dos serviços SEIT."
f" Início: {datetime.datetime.now(): %d/%m/%Y %H:%M:%S}",
end=" ",
)
queryset = Servico.objects.exclude(url="").exclude(
tipo_servico__string_pesquisa=""
)
for obj in queryset:
obj.atualiza_data_uso()
print(f"Término: {datetime.datetime.now(): %d/%m/%Y %H:%M:%S}")

0
sigi/apps/servicos/jobs/hourly/__init__.py

0
sigi/apps/servicos/jobs/monthly/__init__.py

0
sigi/apps/servicos/jobs/weekly/__init__.py

0
sigi/apps/servicos/jobs/yearly/__init__.py

Loading…
Cancel
Save