-
-
Notifications
You must be signed in to change notification settings - Fork 209
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
More flexibility in scheduling a trigger #255
Comments
@derekantrican , I played around with this (with some help from chatGPT because the last time I wrote Javascript was 20 years ago...) and came up with this code. I don't know how to submit a pull request in Github so this is the best version I have of sharing code back to you! Same howFrequent variable, but I added more comments to explain acceptable inputs and how those will be manipulated.***** Modified Install function in Code.gs:**** // Schedule sync routine to explicitly repeat and schedule the initial sync // Schedule sync routine to look for update once per day using everyDays Modified getValidTriggerFrequency function in Helpers.gs* function getValidTriggerFrequency(origFrequency) { // Limit the original frequency to 1440 var acceptableValues = [5, 10, 15, 30].concat( // Find the smallest acceptable value greater than or equal to the original frequency Logger.log( String.prototype.includes = function(phrase){ |
Currently, we use the
everyMinutes
function to schedule triggers, but according to the docs this only accepts 1, 5, 10, 15 or 30 as an input. We should allow a bit of greater flexibility that if you put in 60, 120, or some other multiple of 60 forhowFrequent
then we should use theeveryHours
function insteadThe text was updated successfully, but these errors were encountered: