@@ -152,68 +152,6 @@ const awaitPools = {
152
152
iteration + 1
153
153
);
154
154
},
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
- },
217
155
deleteAttributes: async (databaseId, collectionId, attributeKeys, iteration = 1) => {
218
156
if (iteration > pollMaxDebounces) {
219
157
return false;
@@ -1262,12 +1200,6 @@ const pushSite = async({ siteId, async, code, withVariables } = { returnOnZero:
1262
1200
});
1263
1201
}));
1264
1202
1265
- let result = await awaitPools.wipeSiteVariables(site['$id']);
1266
- if (!result) {
1267
- updaterRow.fail({ errorMessage: `Variable deletion timed out.` })
1268
- return;
1269
- }
1270
-
1271
1203
const envFileLocation = `${site['path']}/.env`;
1272
1204
let envVariables = [];
1273
1205
try {
@@ -1589,12 +1521,6 @@ const pushFunction = async ({ functionId, async, code, withVariables } = { retur
1589
1521
});
1590
1522
}));
1591
1523
1592
- let result = await awaitPools.wipeFunctionVariables(func['$id']);
1593
- if (!result) {
1594
- updaterRow.fail({ errorMessage: `Variable deletion timed out.` })
1595
- return;
1596
- }
1597
-
1598
1524
const envFileLocation = `${func['path']}/.env`;
1599
1525
let envVariables = [];
1600
1526
try {
0 commit comments