Arthur Besse@lemmy.ml to Fuck AI@lemmy.worldEnglish · 17 days ago"lessons learned"imagemessage-square162linkfedilinkarrow-up1631arrow-down110file-text
arrow-up1621arrow-down1image"lessons learned"Arthur Besse@lemmy.ml to Fuck AI@lemmy.worldEnglish · 17 days agomessage-square162linkfedilinkfile-text
minus-square[object Object]@lemmy.worldlinkfedilinkarrow-up1·15 days ago at least one extra nasty corner case I can think of Well, now I’m curious about what that corner case is.
minus-squareAceticon@lemmy.dbzer0.comlinkfedilinkEnglisharrow-up1·14 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·14 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·14 days agoYeah, if the script only ever schedules the next day’s run, that would work fine.
Well, now I’m curious about what that corner case is.
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.