soberhacker / obsidian-telegram-sync

Transfer messages and files from Telegram to Obsidian
GNU Affero General Public License v3.0
303 stars 30 forks source link

FR: Make Insider feature "Process old messages" available not only on plugin reload #286

Open mnaoumov opened 5 months ago

mnaoumov commented 5 months ago

Currently Insider feature "Process old messages" works only on plugin reload. But it would be useful if this check is executed on some other events as well, such as running on schedule and having it is as a custom invocable command

soberhacker commented 4 months ago

It is not clear why you need to process old messages when the plugin is not just reloading. If the plugin operates continuously, there won't be any old messages. Conversely, if the plugin doesn't work, scheduling and command become unnecessary.

mnaoumov commented 4 months ago

@soberhacker in my case, Obsidian is open all the time but it's not doing anything with the computer goes into the sleep mode. When the computer wakes up from it, it doesn't process the old messages appeared during the sleep time

soberhacker commented 4 months ago

Ok, I will add processing of old messages after waking the computer from sleep

mnaoumov commented 4 months ago

Sleep mode is not the only trigger. For example what if the router was disconnected for some time and you didn't have Internet...

mnaoumov commented 4 months ago

I guess more realistic trigger would be to compare with the last successful fetch attempt and if it was way too far away, trigger the reload