Closed rossmacarthur closed 3 years ago
I feel that a built-in scheduled update mechanism would be dispensable, given how strongly established is the practice of delegating such tasks to specialized tools such as cron
. Moreover, there are not many CLI utilities — none come to mind, to be entirely honest! — that will spontaneously perform an update when given unrelated commands.
Perhaps it would be best to keep things lean, here?
I agree, that sounds reasonable, I'm okay with not implementing this.
At the moment you can update all plugins using the following
But there is no way to make sheldon run that periodically. It would be nice to make sheldon run that daily, weekly, fortnightly or a completely arbitrary period.
From https://github.com/rossmacarthur/sheldon/issues/61#issuecomment-617645339
Proposed solution
I think we could have the following in the config file
or
We would then store the last updated time somewhere, and if the current time is greater than the last updated time plus the
every
value then we try update, regardless of the command executed (lock
orsource
).We could accept hours, days, weeks, months, and years.
Unresolved questions
Should multiple units be allowed i.e. "2 weeks 1 day"
Where should the last updated time be stored?
If we store in the
plugins.lock
file then we have to keep track of it every time we relock the file we have to read it and rewrite it. It might be easier to store it in a different file in the data directory. Perhaps some sort ofstate
file.