anufrievroman / calcure

Modern TUI calendar and task manager with minimal and customizable UI.
https://anufrievroman.gitbook.io/calcure
MIT License
1.51k stars 43 forks source link

reload_data on time intervals #97

Closed philsch closed 3 months ago

philsch commented 5 months ago

Hi there,

First, thanks for this project, I really like the clean UI 👍

I'm importing my calendar via ics_event_files and want to keep calcure running during the day. Is there any functionality to refresh the data in certain time intervals (e.g. every 15mins) so changed events are reflected automatically?

anufrievroman commented 5 months ago

Hi, thank you.

No, but you can manually reload with Q. Due to the design of the software, it is difficult to implement good auto refresh. Plus, even if it was there, it would cause some troubles if there's no internet or freeze when the ics file is large. So we decided to keep it as manual update.

P.s. if you or someone else would like to work on it, I'll gladly consider good implementations of this feature.

philsch commented 5 months ago

Without doing a bigger change to the current code base, what do you think about the following idea to solve the freeze problem?

anufrievroman commented 5 months ago

Sorry for the delay, I've been thinking about this solution. And while it's a reasonable solution, basically I think it's a bit overkill for a rather niche problem. I'd say, let's just make a simple auto reloading at set time intervals, with 0 (no reload) as the default. I imagine not many people need this feature and even fewer people have such a huge ics files that they need caching, and even if they have, they can wait once in an hour, as it happens passively on the background. Moreover, such people can solve freezing problem by using vdisyncer or other sync solutions. I think calcure should not take advanced syncing functionality at least at this stage.

So, I'll come from vacation next week and will try a simple implementation of this feature, then we can see that maybe it's enough.

anufrievroman commented 5 months ago

Okay, I implemented the data reload on intervals, so that now there is a parameter data_reload_interval = 0 (in minutes, with 0 to switch off) that controls how often data reload. Actually, it's not precise, as the program itself is reloading every 20 seconds, but for our purpose it is precise enough, I think. It is now in the main branch, and will be available in the next release.

philsch commented 5 months ago

Thanks, that's enough for my working dashboard to update in regular intervals :)