Arthur Besse@lemmy.ml to Fuck AI@lemmy.worldEnglish · 18 days ago"lessons learned"lemmy.mlimagemessage-square162linkfedilinkarrow-up1632arrow-down111file-text
arrow-up1621arrow-down1image"lessons learned"lemmy.mlArthur Besse@lemmy.ml to Fuck AI@lemmy.worldEnglish · 18 days agomessage-square162linkfedilinkfile-text
minus-squareAceticon@lemmy.dbzer0.comlinkfedilinkEnglisharrow-up1·15 days agoThe script can be triggered just before and run during the time that’s calculated as the transition from nighttime to daytime. If that possibility is not taken in account in the implementation there’s a risk that the cron job is scheduled for a bit under 24h later. It’s basically a critical race condition.
minus-square[object Object]@lemmy.worldlinkfedilinkarrow-up2·15 days agoEh, if the script always just calculates the sunrise time for the next day and overwrites the cron job, then its runtime shouldn’t matter — unless it gets stuck for 24 hours.
minus-squareAceticon@lemmy.dbzer0.comlinkfedilinkEnglisharrow-up1·15 days agoYeah, if the script only ever schedules the next day’s run, that would work fine.
The script can be triggered just before and run during the time that’s calculated as the transition from nighttime to daytime.
If that possibility is not taken in account in the implementation there’s a risk that the cron job is scheduled for a bit under 24h later.
It’s basically a critical race condition.
Eh, if the script always just calculates the sunrise time for the next day and overwrites the cron job, then its runtime shouldn’t matter — unless it gets stuck for 24 hours.
Yeah, if the script only ever schedules the next day’s run, that would work fine.