From 24a104eec5645521564468a0d4f38b8fe9a2feae Mon Sep 17 00:00:00 2001 From: Jim MacLeod Date: Fri, 15 Jul 2022 02:05:43 -0700 Subject: [PATCH 1/2] Add onEventUpdated triggers for push support --- .Code.gs.swp | Bin 0 -> 24576 bytes Code.gs | 12 ++++++++++++ 2 files changed, 12 insertions(+) create mode 100644 .Code.gs.swp diff --git a/.Code.gs.swp b/.Code.gs.swp new file mode 100644 index 0000000000000000000000000000000000000000..edcbf33ac69411d15b067cce350ac74b394275e4 GIT binary patch literal 24576 zcmeI4Ym6k$a7A&~+Skh`6gw|hO)Ju~ZFTjQ+b*_qkhF}pL%OwX>J%_gqy zuAV7xbyZVUJ-zM3c4Pz!4~dXO3YI|O8$#ic#3DpQNt6$c01;c505(L4@CWk&q>zB} z0LAb-_ulHR?s@F&KrE2Dwg2g^s{1(ioO92;_ncE(o4UAkUfolkarpe0AUEap$6sR(j5#poz?cJL4vaZ4=D?T(V-ActFy_FR17i-1 zIq(DEfJ<=ycWC#T9Mp;bXXpR#zrk^y2cH1H2%ZFO@cAEgoJ-(#@L#t(&Qsu>;O}p9 zoG$q4kMJ8D1_kh)*E`PFz|-Ip;E%w+-s(7Y@a5Mz&Mf!|@a-RVoWB9jgXh4rpa%Z- z7RUJ__&oR=I1hdaXT$S2B&NY{;aGS9=f%U|S;ipa=*n3BkAJq@ShHe}xVHCHhqPrg|tOrxl6hZb% zyy1raqh7qrXoo3k$6nLFrit>lyf9Uv+wxS`Pd9V-BHd&HXPS`I?8KT&^}vn&w3qce z7kF_h<1h5Qq%h1|;q!368GrknfWcB79)wZqH{p)3HBnKh2{{u*8%Pcz8aZfUc^a#j zpK+=MgS;|99ZBGA)9nN)1zLXC@M74iNt;lGFe>oZ7ATa;dJL3{w!B5*LUKBeTK&FG zDiMc_h%qcRRWItOv=a+qJ|c@$L7vm18}^jpVmGZBH@}xKcfEJ5oOQu)KDnIciIhxmr34GRgHFFn9#Q?*D?ZypLI7>^-ZsSRreS~ z8>)EG_q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fY*R$@DY3zd<4jQ0n^~0 z@ew=^J`Fwwo&=j<1I&T9fLp+8!RPQBJOPT}ZQw8Q6Z{Hz7#s#~1<&Cd5MRM2SOA~l z?Ee(F2qwTcIP-r2yb*khbN)BM^Way(FMyv0FEi+mgP#J=aK`^Ecp7{PG{BwU>zv_V z1YZFk0IT55;QO50Uj!cm?*~0_5ln+4;12K~@bllnH^4`M@HYkeBXh@Z;)&WhxBL2D zD0Chxq9XPTR{lEwF0($n`=z93NB(5K!Mr0$`=;{#0_~j=kCd)LCF?Si25h-SDN{rv zv%ag3_6uzp+WJSq?95#B>-N=!KcEew6Y%(?Y{}@jzYn zuR!bYeeRXLYuX++;H-@Tle}#bI6R&8mX1gv8O4_SKD+ zxKt8e3?cz>=J?bURXOTbqpMyxn;T<@)?UaSCHc)I7l(IVHtMQ^eLf2IsBKaT$g3VdSGpVGiOmA z=pQ9L>tv-JeS1;jPW&6}t`3l6G3Z7%`9eg|bV$QyyI>9lMzs0aImh_rooVzw){|Sj z2$IXdVMT&1=B1rOidR_WB?funpg)rRkqkk$U@k4BpOKN{(13I`xleZN+;)lG+OZP^ hv!*0mmK|e^*u)z3qcmoD7>*yy Logs) to make sure your events are being read correctly before turning this on @@ -104,6 +109,13 @@ function install(){ ScriptApp.newTrigger("startSync").timeBased().everyMinutes(getValidTriggerFrequency(howFrequent)).create(); ScriptApp.newTrigger("startSync").timeBased().after(1000).create(); + //Add push trigger if enabled + if (addUpdateTrigger) { + sourceCalendarOwners.forEach(ownerEmail => + ScriptApp.newTrigger("startSync").forUserCalendar(ownerEmail).onEventUpdated().create() + ) + } + //Schedule sync routine to look for update once per day ScriptApp.newTrigger("checkForUpdate").timeBased().everyDays(1).create(); } From b6adf55146ffa98451ae9b60f20e120adc29386f Mon Sep 17 00:00:00 2001 From: Jim MacLeod Date: Fri, 15 Jul 2022 02:09:04 -0700 Subject: [PATCH 2/2] set reasonable default for new feature (do nothing) --- .Code.gs.swp | Bin 24576 -> 0 bytes Code.gs | 2 +- 2 files changed, 1 insertion(+), 1 deletion(-) delete mode 100644 .Code.gs.swp diff --git a/.Code.gs.swp b/.Code.gs.swp deleted file mode 100644 index edcbf33ac69411d15b067cce350ac74b394275e4..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 24576 zcmeI4Ym6k$a7A&~+Skh`6gw|hO)Ju~ZFTjQ+b*_qkhF}pL%OwX>J%_gqy zuAV7xbyZVUJ-zM3c4Pz!4~dXO3YI|O8$#ic#3DpQNt6$c01;c505(L4@CWk&q>zB} z0LAb-_ulHR?s@F&KrE2Dwg2g^s{1(ioO92;_ncE(o4UAkUfolkarpe0AUEap$6sR(j5#poz?cJL4vaZ4=D?T(V-ActFy_FR17i-1 zIq(DEfJ<=ycWC#T9Mp;bXXpR#zrk^y2cH1H2%ZFO@cAEgoJ-(#@L#t(&Qsu>;O}p9 zoG$q4kMJ8D1_kh)*E`PFz|-Ip;E%w+-s(7Y@a5Mz&Mf!|@a-RVoWB9jgXh4rpa%Z- z7RUJ__&oR=I1hdaXT$S2B&NY{;aGS9=f%U|S;ipa=*n3BkAJq@ShHe}xVHCHhqPrg|tOrxl6hZb% zyy1raqh7qrXoo3k$6nLFrit>lyf9Uv+wxS`Pd9V-BHd&HXPS`I?8KT&^}vn&w3qce z7kF_h<1h5Qq%h1|;q!368GrknfWcB79)wZqH{p)3HBnKh2{{u*8%Pcz8aZfUc^a#j zpK+=MgS;|99ZBGA)9nN)1zLXC@M74iNt;lGFe>oZ7ATa;dJL3{w!B5*LUKBeTK&FG zDiMc_h%qcRRWItOv=a+qJ|c@$L7vm18}^jpVmGZBH@}xKcfEJ5oOQu)KDnIciIhxmr34GRgHFFn9#Q?*D?ZypLI7>^-ZsSRreS~ z8>)EG_qysnbuQXSNz8E z#v5MR*IeZ{ZTTHkQS?nrgC53a)IA-0Ki`pQds0mw-#+Keq!XnJk?j`NqsUz7q@Lku z+_5@r^;70rWW^veJwyOnpUD)va<8LQ0b3N`?_G0S?Z7M7qgF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