1

I have a celery task as follows

@celery_app_site24x7.task(queue='site24x7')
    def createWebsiteMonitoring(**kwargs):
        """ Celery Task to create or update website Moniroting """

        time.sleep(100)
        site24x7Instance = Business_api.thirdpartyFactory.instantiate(
            "site24x7")
        # site24x7Instance.login()
        return site24x7Instance.createWebsiteMonitoring(**kwargs)

In my celery worker log I can find that is succedded with success:

[2019-01-18 15:14:42,633: INFO/ForkPoolWorker-2] Task celery_tasks.site24x7.createWebsiteMonitoring[c2a5ad46-fde0-4c2c-ac46-3d2f7c9f5861] succeeded in 109.22832555975765s: '279832000003624811'

However in Flower I see that its still in "RECEIVED" State:

enter image description here

Am experiencing this issue after i added the time.sleep(100)

Is there any configuration that needs to be added? Or am I doing it wrong?

Am launching flower as follows:

flower -A monitoringExterne --app=monitoringExterne.celerys.$APP --port=8080 --broker=$CONNECTOR/$DATABASE --debug > /dev/stdout

UPDATE

The createWebsiteMonitoring() method sends a requests POST to a URL.

Kheshav Sewnundun
  • 1,236
  • 15
  • 37
  • If you say the issue only appears after adding that long sleep, it sounds like the task is timing out in some way. Why do you need that sleep there? – AKX Jan 22 '19 at 09:51
  • @AKX The URL / API am posting to has some internal limits in the number of POST/GET i can perform within 5mins, if my limit is reached my account is blocked for 2 mins. SInce am doing a mass POST, i added the sleep to avoid reaching the threshold limit . – Kheshav Sewnundun Jan 22 '19 at 09:57

0 Answers0