Skip to content

Commit

Permalink
Merge pull request #11 from kanazawarb/use_flush
Browse files Browse the repository at this point in the history
SpreadsheetApp.flush で書き込みを高速化する
  • Loading branch information
muryoimpl authored Feb 9, 2024
2 parents 4f0b02d + f9a36f7 commit d311b42
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions command.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,13 +74,15 @@ function doPost(e) {
1,
entryLine.length,
).setValues([entryLine]);
SpreadsheetApp.flush()

const payload = createMessagePayload(
`${userName} さんから LT: 「${title}」のエントリがありました。entryId: ${startRowNum + row}`
);
return createPublicTextOutput(payload);
}
}

return ContentService.createTextOutput(messages.full_entry);
}
case 'remove': { // 番号指定でエントリを削除扱いにする
Expand Down Expand Up @@ -221,6 +223,7 @@ function doPost(e) {
container.length,
1,
).setValues([...statuses]);
SpreadsheetApp.flush()

// シャッフルした番号の配列をつくる
const orderNumbers = indexesNumbers(container.length);
Expand Down Expand Up @@ -263,6 +266,7 @@ function doPost(e) {
container.length,
1,
).setValues([...values]);
SpreadsheetApp.flush()

return ContentService.createTextOutput(messages.reset_order);
}
Expand All @@ -284,6 +288,7 @@ function doPost(e) {
1,
).setValue(status.DELIMITED)
}
SpreadsheetApp.flush()

const payload = createMessagePayload(messages.delimit_time);
return createPublicTextOutput(payload);
Expand Down

0 comments on commit d311b42

Please sign in to comment.