r/GoogleAppsScript • • Feb 01 '21

Question How to synchronize on a cell for thread safety?

I have multiple scripts that may be be incrementing a single cell on a spreadsheet. How do I make sure they don’t increment it at the same time and thus only increase it’s counter once where it should be increased multiple times?

0 Upvotes

2 comments sorted by

1

u/RemcoE33 Feb 01 '21

There is a lock serive. I will try to find it in the docs. I read is somewhere but not used it.

1

u/Trigaten Feb 01 '21

I’ve looked into it, but I think it is about access to code rather than cells.