How to check if a function in Google App Script is already being executed by another user? -




i have function (function doget()) in google app script being called chrome extension. function being called everytime user clicks button in chrome extension popup.html. button in popup.html simultaneously being clicked 30+ users. can place check if function being executed 1 user, next user cannot execute till ?

you can use lock service of app script.

the lock service allows scripts prevents concurrent access sections of code. can useful when have multiple users or processes modifying shared resource , want prevent collisions.

function doget(){   var lock = lockservice.getscriptlock();   lock.waitlock(10000); // in milliseconds  // code   lock.releaselock(); } 




wiki

Comments

Popular posts from this blog

Asterisk AGI Python Script to Dialplan does not work -

python - Read npy file directly from S3 StreamingBody -

kotlin - Out-projected type in generic interface prohibits the use of metod with generic parameter -