[Fixed]-Python function when added to cron using django-crontab gives "No JSON object could be decoded" ERROR

1👍

✅

You get “No JSON object could be decoded” error when you have no response from the api.

Even i had the same issue.I was making a REST api call to splunk where i wanted to collect summary_index data generated every 30 minutes.So my cron was running every 30 minutes. But at every 30th minute the api was still aggregating the data so it failed every 30th minute.
When i hit the api with a time delay (that is the time for data to get aggregated properly) , i was getting the response.

So now my cron is like this :

 5-59/30 * * * *

This cron will run at 5 minutes after, 35 minutes after

Leave a comment