Skip to content

Commit a1c3847

Browse files
committed
fix(core): increase session backup gh command buffer
1 parent 59353b4 commit a1c3847

2 files changed

Lines changed: 4 additions & 0 deletions

File tree

scripts/session-backup-gist.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ const fs = require("node:fs");
2929
const path = require("node:path");
3030
const { execSync, spawnSync } = require("node:child_process");
3131
const os = require("node:os");
32+
const GH_MAX_BUFFER_BYTES = 32 * 1024 * 1024;
3233

3334
const {
3435
buildBlobUrl,
@@ -142,6 +143,7 @@ const ghCommand = (args, ghEnv) => {
142143
const result = spawnSync("gh", args, {
143144
encoding: "utf8",
144145
stdio: ["pipe", "pipe", "pipe"],
146+
maxBuffer: GH_MAX_BUFFER_BYTES,
145147
env: ghEnv,
146148
});
147149

scripts/session-backup-repo.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ const { spawnSync } = require("node:child_process");
77

88
const BACKUP_REPO_NAME = "docker-git-sessions";
99
const BACKUP_DEFAULT_BRANCH = "main";
10+
const GH_MAX_BUFFER_BYTES = 32 * 1024 * 1024;
1011
// Keep each stored object below GitHub's 100 MB limit while transport batches stay smaller.
1112
const MAX_REPO_FILE_SIZE = 99 * 1000 * 1000;
1213
const MAX_PUSH_BATCH_BYTES = 50 * 1000 * 1000;
@@ -163,6 +164,7 @@ const ghCommand = (args, ghEnv, inputFilePath = null) => {
163164
const result = spawnSync("gh", resolvedArgs, {
164165
encoding: "utf8",
165166
stdio: ["pipe", "pipe", "pipe"],
167+
maxBuffer: GH_MAX_BUFFER_BYTES,
166168
env: ghEnv,
167169
});
168170

0 commit comments

Comments
 (0)