-
-
Notifications
You must be signed in to change notification settings - Fork 197
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Request] Add feature to allow each target calendar to have a different sync refresh #346
Comments
You can set up multiple copys of the script with different sync intervals. |
@jonas0b1011001 and @derekantrican, I'd love your thoughts on this. As I was working on the code for Issue #255, I started working on something for this request too, but I couldn't get the pieces to fall into place. I got inspiration from the "arguments" that are in the sourceCalendars... e.g. "URL", "Target Calendar", "colorID". So I started thinking, what if I just kept adding arguments like frequency (5,10, 60, etc.). However, that would require the entire script to be run on one trigger (say 5 minutes), but each individual calendar may or may not get run during that trigger event. The biggest problem I couldn't solve was getting the script to process each sourceCalendar entry individually instead of merging them together into a target calendar. I got close many times, but again, my Javascript is pretty bad and I couldn't get it over the finish line. If I could get that to work, then it felt like we would need two modifications to make the idea work. 1. Add an argument for "Calendar Name" which would need to be unique for each source calendar then use this in the fromGAS statement so there wouldn't be any conflicts with which sourceCalendar wrote to that targetCalendar. 2. Add an argument for frequency in each sourceCalendar entry, but also a way to track the last run time of that entry. Then in the loop, check to see if current time minus last run time is greater than the frequency argument and run startSync on that source calendar if it is. If not, just ignore it until the next run. Then I started thinking about other issues that have been raised about "Include only where Subject=xxx" or "Exclude where xxx" and thought these calendar-level arguments could be an enabler for those functions as well. There's probably a cleaner way to variablize those inputs instead of having them all on one row for a given entry, but I at least wanted to throw out the concept. Sorry I couldn't contribute any code for this solution though! |
I just submitted a pull request (#372 ) called Sync Delay which addresses this Issue. |
Is your feature request related to a problem? Please describe.
No
Describe the solution you'd like
I currenlty have 4 calendars. 3 Calendars are updated a few times during the month because all the events in those calendars are recurring events. I hae 1 calendar that updates on the fly, and would like that specific calendar to update more frequently, maybe every 5 minutes.
So in other words, if the frequency for the other calendars are left as default, then it would use the script default of 15 minutes. Otherwise, a frequency would be added along with the source calendars.
Additional context
No response
The text was updated successfully, but these errors were encountered: