Author Topic: Cron job NWS Alerts using cron-job.org failure  (Read 557 times)

0 Members and 1 Guest are viewing this topic.

Offline AmateurExtra

  • Member
  • *
  • Posts: 14
  • Amateur Radio Operator Extra Class - N3UVR
    • N3UVR's Backyard Weather Station
Cron job NWS Alerts using cron-job.org failure
« on: February 21, 2021, 09:12:32 PM »
Hello,

I am using cron-job.org to load nws-alerts.php at 10 minute intervals. Today, I received a failure notice with the statement that the response data is too big and the job is disabled. I changed to 15 minute intervals to see if that would ameliorate the problem and it did not. I wonder if it is a problem from NWS or cron-job.org. Does anyone have any information that the fault may lie with NWS? My version of nws-alerts.php is current according to check-fetch-times.
These are the responses that I am receiving:

   Today, 19:00:03    Today, 19:00:00    3,19 s    24,48 s    Response data too big    
   Today, 18:45:01    Today, 18:45:00    1,05 s    24,49 s    Response data too big    
   Today, 18:30:02    Today, 18:30:00    2,45 s    24,46 s    Response data too big    
   Today, 18:15:01    Today, 18:15:00    1,17 s    24,58 s    Response data too big    
   Today, 18:00:02    Today, 18:00:00    2,37 s    24,32 s    Response data too big    
   Today, 17:45:01    Today, 17:45:00    1,25 s    24,64 s    Response data too big
"And therefore never send to know for whom
the bell tolls; it tolls for thee."

"For Whom the Bell Tolls"
by John Donne

Offline Jasiu

  • Forecaster
  • *****
  • Posts: 951
    • LexMAWeather
Re: Cron job NWS Alerts using cron-job.org failure
« Reply #1 on: February 22, 2021, 08:43:20 AM »
Maybe this?

https://cron-job.org/en/faq/

Quote
How and how long does cron-job.org visit my URLs?
    cron-job.org visits your URLs at the configured dates/intervals and waits for the URL/script to finish execution. If your URL/script does not finish after 30 seconds, it will timeout and we will close the connection to prevent delays in the execution of the jobs of other users. Our system reads up to 1024 bytes of the output of your URLs/scripts. In case your script sends more data, job execution will be aborted. (Please also see the next question.)

What should I keep in mind when developing my cron-controlled scripts?
    You should design your scripts in a way that they send as little data as possible, ideally just a short status message at the end of the execution, e.g. "OK" — or simply nothing. In case your script is written in PHP and needs more than 30 seconds of run-time, you can use the following trick to let it continue to execute in the background: Use the PHP function ignore_user_abort(true) to tell PHP to continue the script execution after disconnection.

Run the cron job from your browser and then do a view-source. You'll quickly see if you are exceeding the limit.
https://lexmaweather.info
On Mastodon: @LexMAWeather@toot.community

Offline AmateurExtra

  • Member
  • *
  • Posts: 14
  • Amateur Radio Operator Extra Class - N3UVR
    • N3UVR's Backyard Weather Station
Re: Cron job NWS Alerts using cron-job.org failure
« Reply #2 on: February 22, 2021, 10:35:25 AM »
Thanks for your reply. Initially, I had weather alerts set for 12 counties and the job ran smoothly with some occasional failures but none for output too large. I decided to see if reducing to 7 counties would work. I set alerts for the 6 contiguous counties to mine and so far, all is well. According to the history screen, I am averaging about 14.5 seconds. I am thinking that perhaps the occasional failure was due to the fact that I had too many counties set to receive alerts. The history will decide if that is true. Thanks again for your help.
"And therefore never send to know for whom
the bell tolls; it tolls for thee."

"For Whom the Bell Tolls"
by John Donne

 

anything