Created
April 6, 2016 16:21
-
-
Save DominicBreuker/378608a06fcf50cd6f889854f9b0979a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function callWithScriptLock(callback, arg1, arg2) { | |
var lock = LockService.getScriptLock(); | |
lock.waitLock(30000); | |
try { | |
return callback(arg1, arg2); | |
} finally { | |
lock.releaseLock(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment