Skip to content

Commit f82b346

Browse files
committed
chore: remove awaitpools
1 parent 25a36d8 commit f82b346

File tree

1 file changed

+0
-74
lines changed

1 file changed

+0
-74
lines changed

templates/cli/lib/commands/push.js.twig

Lines changed: 0 additions & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -152,68 +152,6 @@ const awaitPools = {
152152
iteration + 1
153153
);
154154
},
155-
wipeFunctionVariables: async (functionId, iteration = 1) => {
156-
if (iteration > pollMaxDebounces) {
157-
return false;
158-
}
159-
160-
const { total } = await functionsListVariables({
161-
functionId,
162-
queries: ['limit(1)'],
163-
parseOutput: false
164-
});
165-
166-
if (total === 0) {
167-
return true;
168-
}
169-
170-
if (pollMaxDebounces === POLL_DEFAULT_VALUE) {
171-
let steps = Math.max(1, Math.ceil(total / STEP_SIZE));
172-
if (steps > 1 && iteration === 1) {
173-
pollMaxDebounces *= steps;
174-
175-
log('Found a large number of variables, increasing timeout to ' + (pollMaxDebounces * POLL_DEBOUNCE / 1000 / 60) + ' minutes')
176-
}
177-
}
178-
179-
await new Promise(resolve => setTimeout(resolve, POLL_DEBOUNCE));
180-
181-
return await awaitPools.wipeFunctionVariables(
182-
functionId,
183-
iteration + 1
184-
);
185-
},
186-
wipeSiteVariables: async (siteId, iteration = 1) => {
187-
if (iteration > pollMaxDebounces) {
188-
return false;
189-
}
190-
191-
const { total } = await sitesListVariables({
192-
siteId,
193-
queries: ['limit(1)'],
194-
parseOutput: false
195-
});
196-
197-
if (total === 0) {
198-
return true;
199-
}
200-
201-
if (pollMaxDebounces === POLL_DEFAULT_VALUE) {
202-
let steps = Math.max(1, Math.ceil(total / STEP_SIZE));
203-
if (steps > 1 && iteration === 1) {
204-
pollMaxDebounces *= steps;
205-
206-
log('Found a large number of variables, increasing timeout to ' + (pollMaxDebounces * POLL_DEBOUNCE / 1000 / 60) + ' minutes')
207-
}
208-
}
209-
210-
await new Promise(resolve => setTimeout(resolve, POLL_DEBOUNCE));
211-
212-
return await awaitPools.wipeSiteVariables(
213-
siteId,
214-
iteration + 1
215-
);
216-
},
217155
deleteAttributes: async (databaseId, collectionId, attributeKeys, iteration = 1) => {
218156
if (iteration > pollMaxDebounces) {
219157
return false;
@@ -1262,12 +1200,6 @@ const pushSite = async({ siteId, async, code, withVariables } = { returnOnZero:
12621200
});
12631201
}));
12641202

1265-
let result = await awaitPools.wipeSiteVariables(site['$id']);
1266-
if (!result) {
1267-
updaterRow.fail({ errorMessage: `Variable deletion timed out.` })
1268-
return;
1269-
}
1270-
12711203
const envFileLocation = `${site['path']}/.env`;
12721204
let envVariables = [];
12731205
try {
@@ -1589,12 +1521,6 @@ const pushFunction = async ({ functionId, async, code, withVariables } = { retur
15891521
});
15901522
}));
15911523

1592-
let result = await awaitPools.wipeFunctionVariables(func['$id']);
1593-
if (!result) {
1594-
updaterRow.fail({ errorMessage: `Variable deletion timed out.` })
1595-
return;
1596-
}
1597-
15981524
const envFileLocation = `${func['path']}/.env`;
15991525
let envVariables = [];
16001526
try {

0 commit comments

Comments
 (0)