Skip to content

Commit bcac47f

Browse files
Merge pull request #6705 from Shopify/bulk_ops_upload_slow_request
Better handling of slow networks for bulk variable upload
2 parents 46aaf4f + 1b61fee commit bcac47f

File tree

1 file changed

+14
-3
lines changed

1 file changed

+14
-3
lines changed

packages/app/src/cli/services/bulk-operations/stage-file.ts

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ import {adminRequestDoc} from '@shopify/cli-kit/node/api/admin'
77
import {AdminSession} from '@shopify/cli-kit/node/session'
88
import {formData, fetch} from '@shopify/cli-kit/node/http'
99
import {AbortError} from '@shopify/cli-kit/node/error'
10+
import {outputContent} from '@shopify/cli-kit/node/output'
11+
import {renderSingleTask} from '@shopify/cli-kit/node/ui'
1012

1113
interface StageFileOptions {
1214
adminSession: AdminSession
@@ -106,9 +108,18 @@ async function uploadFileToStagedUrl(
106108
contentType: 'text/jsonl',
107109
})
108110

109-
const uploadResponse = await fetch(uploadUrl, {
110-
method: 'POST',
111-
body: form,
111+
const uploadResponse = await renderSingleTask({
112+
title: outputContent`Uploading bulk operation variables`,
113+
task: async () => {
114+
return fetch(
115+
uploadUrl,
116+
{
117+
method: 'POST',
118+
body: form,
119+
},
120+
'slow-request',
121+
)
122+
},
112123
})
113124

114125
if (!uploadResponse.ok) {

0 commit comments

Comments
 (0)