Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Watchdog had the following error in it this morning:
Download location for METAR data is not accessible.
This occurred at 05:57 server time. I have cron configured to run and update the weather data hourly, so it ran again at 7:00 and 8:00, and then for good measure I ran it once more manually a few minutes ago. The weather data was not updated. The only way to force an update is to delete the row with the old data from the database, which forces the module to rebuild it on the next page load in which the block is displayed.
Comments
Comment #1
toddy CreditAttribution: toddy commentedHi,
if the download location is not available, the module will check again after 10 minutes. If the data still cannot be downloaded, the next check occurs after 3 hours, then 6, 12, and 24 hours after the initial download attempt. From then on, the module tries once a day to download the weather data. You don't need to manually delete the row. Judging from the times you've mentioned above, you've probably just missed the three-hour-check. Could that be the explanation?
Regards,
Tobias
Comment #2
macman824 CreditAttribution: macman824 commentedHi toddy,
To test your suggestion, I let the module sit with outdated data for three days -- it never changed in that time (and the METAR data was quite accessible; as soon as I deleted the row it repopulated with the current METAR). Since this doesn't appear to match up with your design intent, I've gone ahead and re-opened the issue. I feel like the problem might be here on line 2073-2075 of weather.module:
$last_update is set to the raw METAR data, which is a string. That string then has arithmetic performed on it as if it was a timestamp, but it's not. I suggest the following change:
Comment #3
toddy CreditAttribution: toddy commentedYou're right, thanks for checking that again. I'll prepare a fix.
Comment #4
toddy CreditAttribution: toddy commentedHi,
this should be fixed in the latest release, 6.x-5.20.