Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
from __future__ import absolute_import
from celery import shared_task
# import the logging library
import logging
# Get an instance of a logger
logger = logging.getLogger(__name__)
def sendScheduledAlertTask(pk, scheduling_id):
from alerts.models import MaintenanceAlert'entrei no task com pk igual a e tipo ' + str(pk) + str(type(pk)))'tentei chegar no scheduling_id com ' + str(scheduling_id))
alert = MaintenanceAlert.objects.get(pk=pk)
except MaintenanceAlert.DoesNotExist:
return'entrei no task com o alerta %s' %
if alert.status == MaintenanceAlert.SCHEDULED_TO_SEND and alert.scheduling_id == scheduling_id:'entrei na atividade com o alerta %s' %
alert.task_id = None
alert.scheduling_id = None
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.