@remotion/lambda 4.0.256 → 4.0.258
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli/get-aws-region.js +2 -1
- package/dist/cli/index.js +5 -4
- package/dist/shared/check-credentials.js +7 -6
- package/dist/shared/get-credentials.js +25 -23
- package/dist/shared/get-env-variable.d.ts +1 -0
- package/dist/shared/get-env-variable.js +15 -0
- package/dist/shared/get-service-client.js +16 -15
- package/dist/shared/is-likely-to-have-aws-profile.js +7 -1
- package/package.json +21 -21
- package/remotionlambda-arm64.zip +0 -0
- package/dist/api/__mocks__/clean-items.d.ts +0 -2
- package/dist/api/__mocks__/clean-items.js +0 -24
- package/dist/api/__mocks__/create-function.d.ts +0 -2
- package/dist/api/__mocks__/create-function.js +0 -21
- package/dist/api/__mocks__/delete-function.d.ts +0 -2
- package/dist/api/__mocks__/delete-function.js +0 -9
- package/dist/api/__mocks__/get-functions.d.ts +0 -2
- package/dist/api/__mocks__/get-functions.js +0 -9
- package/dist/api/__mocks__/upload-dir.d.ts +0 -3
- package/dist/api/__mocks__/upload-dir.js +0 -47
- package/dist/api/mock-functions.d.ts +0 -18
- package/dist/api/mock-functions.js +0 -36
- package/dist/cli/helpers/__mocks__/quit.d.ts +0 -1
- package/dist/cli/helpers/__mocks__/quit.js +0 -7
- package/dist/functions/chunk-optimization/plan-frame-ranges.d.ts +0 -7
- package/dist/functions/chunk-optimization/plan-frame-ranges.js +0 -17
- package/dist/functions/chunk-optimization/types.d.ts +0 -8
- package/dist/functions/chunk-optimization/types.js +0 -2
- package/dist/functions/helpers/__mocks__/get-browser-instance.d.ts +0 -3
- package/dist/functions/helpers/__mocks__/get-browser-instance.js +0 -12
- package/dist/functions/helpers/__mocks__/leak-detection.d.ts +0 -4
- package/dist/functions/helpers/__mocks__/leak-detection.js +0 -9
- package/dist/functions/helpers/__mocks__/timer.d.ts +0 -2
- package/dist/functions/helpers/__mocks__/timer.js +0 -10
- package/dist/functions/helpers/best-frames-per-lambda-param.d.ts +0 -1
- package/dist/functions/helpers/best-frames-per-lambda-param.js +0 -17
- package/dist/functions/helpers/calculate-chunk-times.d.ts +0 -5
- package/dist/functions/helpers/calculate-chunk-times.js +0 -29
- package/dist/functions/helpers/calculate-price-from-bucket.d.ts +0 -15
- package/dist/functions/helpers/calculate-price-from-bucket.js +0 -30
- package/dist/functions/helpers/can-concat-seamlessly.d.ts +0 -3
- package/dist/functions/helpers/can-concat-seamlessly.js +0 -17
- package/dist/functions/helpers/cleanup-props.d.ts +0 -8
- package/dist/functions/helpers/cleanup-props.js +0 -23
- package/dist/functions/helpers/concat-videos.d.ts +0 -23
- package/dist/functions/helpers/concat-videos.js +0 -54
- package/dist/functions/helpers/create-post-render-data.d.ts +0 -17
- package/dist/functions/helpers/create-post-render-data.js +0 -67
- package/dist/functions/helpers/find-output-file-in-bucket.d.ts +0 -14
- package/dist/functions/helpers/find-output-file-in-bucket.js +0 -38
- package/dist/functions/helpers/format-costs-info.d.ts +0 -2
- package/dist/functions/helpers/format-costs-info.js +0 -23
- package/dist/functions/helpers/get-overall-progress-s3.d.ts +0 -10
- package/dist/functions/helpers/get-overall-progress-s3.js +0 -24
- package/dist/functions/helpers/get-overall-progress.d.ts +0 -9
- package/dist/functions/helpers/get-overall-progress.js +0 -23
- package/dist/functions/helpers/get-progress.d.ts +0 -15
- package/dist/functions/helpers/get-progress.js +0 -254
- package/dist/functions/helpers/get-retry-stats.d.ts +0 -5
- package/dist/functions/helpers/get-retry-stats.js +0 -2
- package/dist/functions/helpers/inspect-errors.d.ts +0 -4
- package/dist/functions/helpers/inspect-errors.js +0 -39
- package/dist/functions/helpers/is-warm.d.ts +0 -2
- package/dist/functions/helpers/is-warm.js +0 -10
- package/dist/functions/helpers/leak-detection.d.ts +0 -4
- package/dist/functions/helpers/leak-detection.js +0 -40
- package/dist/functions/helpers/make-timeout-error.d.ts +0 -10
- package/dist/functions/helpers/make-timeout-error.js +0 -31
- package/dist/functions/helpers/make-timeout-message.d.ts +0 -10
- package/dist/functions/helpers/make-timeout-message.js +0 -75
- package/dist/functions/helpers/merge-chunks.d.ts +0 -36
- package/dist/functions/helpers/merge-chunks.js +0 -84
- package/dist/functions/helpers/min-max.d.ts +0 -2
- package/dist/functions/helpers/min-max.js +0 -33
- package/dist/functions/helpers/on-downloads-logger.d.ts +0 -2
- package/dist/functions/helpers/on-downloads-logger.js +0 -29
- package/dist/functions/helpers/overall-render-progress.d.ts +0 -59
- package/dist/functions/helpers/overall-render-progress.js +0 -180
- package/dist/functions/helpers/print-concurrency-curve.d.ts +0 -1
- package/dist/functions/helpers/print-concurrency-curve.js +0 -8
- package/dist/functions/helpers/print-logging-helper.d.ts +0 -4
- package/dist/functions/helpers/print-logging-helper.js +0 -12
- package/dist/functions/helpers/render-has-audio-video.d.ts +0 -6
- package/dist/functions/helpers/render-has-audio-video.js +0 -21
- package/dist/functions/helpers/request-context.d.ts +0 -5
- package/dist/functions/helpers/request-context.js +0 -2
- package/dist/functions/helpers/stream-renderer.d.ts +0 -17
- package/dist/functions/helpers/stream-renderer.js +0 -148
- package/dist/functions/launch.d.ts +0 -10
- package/dist/functions/launch.js +0 -595
- package/dist/functions/progress.d.ts +0 -11
- package/dist/functions/progress.js +0 -51
- package/dist/functions/renderer.d.ts +0 -17
- package/dist/functions/renderer.js +0 -341
- package/dist/functions/start.d.ts +0 -13
- package/dist/functions/start.js +0 -112
- package/dist/functions/still.d.ts +0 -19
- package/dist/functions/still.js +0 -329
- package/dist/shared/__mocks__/aws-clients.d.ts +0 -2
- package/dist/shared/__mocks__/aws-clients.js +0 -62
- package/dist/shared/__mocks__/bundle-site.d.ts +0 -2
- package/dist/shared/__mocks__/bundle-site.js +0 -32
- package/dist/shared/__mocks__/check-credentials.d.ts +0 -1
- package/dist/shared/__mocks__/check-credentials.js +0 -5
- package/dist/shared/__mocks__/get-account-id.d.ts +0 -2
- package/dist/shared/__mocks__/get-account-id.js +0 -11
- package/dist/shared/__mocks__/read-dir.d.ts +0 -2
- package/dist/shared/__mocks__/read-dir.js +0 -13
- package/dist/shared/call-lambda.d.ts +0 -16
- package/dist/shared/call-lambda.js +0 -149
- package/dist/shared/cleanup-serialized-input-props.d.ts +0 -14
- package/dist/shared/cleanup-serialized-input-props.js +0 -34
- package/dist/shared/docs-url.d.ts +0 -1
- package/dist/shared/docs-url.js +0 -4
- package/dist/shared/get-most-expensive-chunks.d.ts +0 -8
- package/dist/shared/get-most-expensive-chunks.js +0 -28
- package/dist/shared/invoke-webhook.d.ts +0 -48
- package/dist/shared/invoke-webhook.js +0 -140
- package/dist/shared/parse-lambda-timings-key.d.ts +0 -5
- package/dist/shared/parse-lambda-timings-key.js +0 -2
- package/dist/shared/return-values.d.ts +0 -16
- package/dist/shared/return-values.js +0 -2
- package/dist/shared/stackback.d.ts +0 -6
- package/dist/shared/stackback.js +0 -59
- package/dist/shared/validate-download-behavior.d.ts +0 -1
- package/dist/shared/validate-download-behavior.js +0 -21
- package/dist/shared/validate-frames-per-lambda.d.ts +0 -4
- package/dist/shared/validate-frames-per-lambda.js +0 -29
- package/dist/shared/validate-privacy.d.ts +0 -2
- package/dist/shared/validate-privacy.js +0 -14
- package/dist/shared/validate.d.ts +0 -4
- package/dist/shared/validate.js +0 -8
- package/dist/shared/why-is-node-running.d.ts +0 -15
- package/dist/shared/why-is-node-running.js +0 -88
|
@@ -1,254 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getProgress = void 0;
|
|
4
|
-
const pure_1 = require("@remotion/renderer/pure");
|
|
5
|
-
const client_1 = require("@remotion/serverless/client");
|
|
6
|
-
const no_react_1 = require("remotion/no-react");
|
|
7
|
-
const constants_1 = require("../../shared/constants");
|
|
8
|
-
const calculate_chunk_times_1 = require("./calculate-chunk-times");
|
|
9
|
-
const calculate_price_from_bucket_1 = require("./calculate-price-from-bucket");
|
|
10
|
-
const format_costs_info_1 = require("./format-costs-info");
|
|
11
|
-
const get_overall_progress_1 = require("./get-overall-progress");
|
|
12
|
-
const get_overall_progress_s3_1 = require("./get-overall-progress-s3");
|
|
13
|
-
const inspect_errors_1 = require("./inspect-errors");
|
|
14
|
-
const make_timeout_error_1 = require("./make-timeout-error");
|
|
15
|
-
const render_has_audio_video_1 = require("./render-has-audio-video");
|
|
16
|
-
const getProgress = async ({ bucketName, renderId, expectedBucketOwner, region, memorySizeInMb, timeoutInMilliseconds, customCredentials, providerSpecifics, forcePathStyle, functionName, }) => {
|
|
17
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u;
|
|
18
|
-
const overallProgress = await (0, get_overall_progress_s3_1.getOverallProgressS3)({
|
|
19
|
-
renderId,
|
|
20
|
-
bucketName,
|
|
21
|
-
expectedBucketOwner,
|
|
22
|
-
region,
|
|
23
|
-
providerSpecifics,
|
|
24
|
-
forcePathStyle,
|
|
25
|
-
});
|
|
26
|
-
if (overallProgress.postRenderData) {
|
|
27
|
-
if (!overallProgress.renderMetadata) {
|
|
28
|
-
throw new Error('No render metadata found even though render is finished');
|
|
29
|
-
}
|
|
30
|
-
if (overallProgress.renderMetadata.type === 'still') {
|
|
31
|
-
throw new Error("You don't need to call getRenderProgress() on a still render. Once you have obtained the `renderId`, the render is already done! 😉");
|
|
32
|
-
}
|
|
33
|
-
const outData = (0, client_1.getExpectedOutName)(overallProgress.renderMetadata, bucketName, customCredentials);
|
|
34
|
-
const totalFrameCount = pure_1.NoReactAPIs.getFramesToRender(overallProgress.renderMetadata.frameRange, overallProgress.renderMetadata.everyNthFrame).length;
|
|
35
|
-
return {
|
|
36
|
-
framesRendered: totalFrameCount,
|
|
37
|
-
bucket: bucketName,
|
|
38
|
-
renderSize: overallProgress.postRenderData.renderSize,
|
|
39
|
-
chunks: overallProgress.renderMetadata.totalChunks,
|
|
40
|
-
cleanup: {
|
|
41
|
-
doneIn: overallProgress.postRenderData.timeToCleanUp,
|
|
42
|
-
filesDeleted: overallProgress.postRenderData.filesCleanedUp,
|
|
43
|
-
minFilesToDelete: overallProgress.postRenderData.filesCleanedUp,
|
|
44
|
-
},
|
|
45
|
-
costs: {
|
|
46
|
-
accruedSoFar: overallProgress.postRenderData.cost.estimatedCost,
|
|
47
|
-
displayCost: overallProgress.postRenderData.cost.estimatedDisplayCost,
|
|
48
|
-
currency: overallProgress.postRenderData.cost.currency,
|
|
49
|
-
disclaimer: overallProgress.postRenderData.cost.disclaimer,
|
|
50
|
-
},
|
|
51
|
-
currentTime: Date.now(),
|
|
52
|
-
done: true,
|
|
53
|
-
encodingStatus: {
|
|
54
|
-
framesEncoded: totalFrameCount,
|
|
55
|
-
combinedFrames: totalFrameCount,
|
|
56
|
-
timeToCombine: overallProgress.postRenderData.timeToCombine,
|
|
57
|
-
},
|
|
58
|
-
errors: overallProgress.postRenderData.errors,
|
|
59
|
-
fatalErrorEncountered: false,
|
|
60
|
-
lambdasInvoked: overallProgress.renderMetadata.totalChunks,
|
|
61
|
-
outputFile: overallProgress.postRenderData.outputFile,
|
|
62
|
-
renderId,
|
|
63
|
-
timeToFinish: overallProgress.postRenderData.timeToFinish,
|
|
64
|
-
timeToFinishChunks: overallProgress.postRenderData.timeToRenderChunks,
|
|
65
|
-
timeToRenderFrames: overallProgress.postRenderData.timeToRenderFrames,
|
|
66
|
-
overallProgress: 1,
|
|
67
|
-
retriesInfo: overallProgress.postRenderData.retriesInfo,
|
|
68
|
-
outKey: outData.key,
|
|
69
|
-
outBucket: outData.renderBucketName,
|
|
70
|
-
mostExpensiveFrameRanges: (_a = overallProgress.postRenderData.mostExpensiveFrameRanges) !== null && _a !== void 0 ? _a : null,
|
|
71
|
-
timeToEncode: overallProgress.postRenderData.timeToEncode,
|
|
72
|
-
outputSizeInBytes: overallProgress.postRenderData.outputSize,
|
|
73
|
-
type: 'success',
|
|
74
|
-
estimatedBillingDurationInMilliseconds: overallProgress.postRenderData.estimatedBillingDurationInMilliseconds,
|
|
75
|
-
timeToCombine: overallProgress.postRenderData.timeToCombine,
|
|
76
|
-
combinedFrames: totalFrameCount,
|
|
77
|
-
renderMetadata: overallProgress.renderMetadata,
|
|
78
|
-
timeoutTimestamp: overallProgress.timeoutTimestamp,
|
|
79
|
-
compositionValidated: overallProgress.compositionValidated,
|
|
80
|
-
functionLaunched: overallProgress.functionLaunched,
|
|
81
|
-
serveUrlOpened: overallProgress.serveUrlOpened,
|
|
82
|
-
artifacts: overallProgress.receivedArtifact,
|
|
83
|
-
};
|
|
84
|
-
}
|
|
85
|
-
const { renderMetadata } = overallProgress;
|
|
86
|
-
const errorExplanations = (0, inspect_errors_1.inspectErrors)({
|
|
87
|
-
errors: overallProgress.errors,
|
|
88
|
-
});
|
|
89
|
-
const { hasAudio, hasVideo } = renderMetadata
|
|
90
|
-
? (0, render_has_audio_video_1.lambdaRenderHasAudioVideo)(renderMetadata)
|
|
91
|
-
: { hasAudio: false, hasVideo: false };
|
|
92
|
-
const chunkCount = (_b = overallProgress.chunks.length) !== null && _b !== void 0 ? _b : 0;
|
|
93
|
-
const cleanup = {
|
|
94
|
-
doneIn: null,
|
|
95
|
-
minFilesToDelete: 0,
|
|
96
|
-
filesDeleted: 0,
|
|
97
|
-
};
|
|
98
|
-
if (renderMetadata === null) {
|
|
99
|
-
return {
|
|
100
|
-
framesRendered: (_c = overallProgress.framesRendered) !== null && _c !== void 0 ? _c : 0,
|
|
101
|
-
chunks: chunkCount,
|
|
102
|
-
done: false,
|
|
103
|
-
encodingStatus: {
|
|
104
|
-
framesEncoded: overallProgress.framesEncoded,
|
|
105
|
-
combinedFrames: overallProgress.combinedFrames,
|
|
106
|
-
timeToCombine: overallProgress.timeToCombine,
|
|
107
|
-
},
|
|
108
|
-
timeToRenderFrames: overallProgress.timeToRenderFrames,
|
|
109
|
-
costs: (0, format_costs_info_1.formatCostsInfo)(0),
|
|
110
|
-
renderId,
|
|
111
|
-
renderMetadata,
|
|
112
|
-
bucket: bucketName,
|
|
113
|
-
outputFile: null,
|
|
114
|
-
timeToFinish: null,
|
|
115
|
-
errors: errorExplanations,
|
|
116
|
-
fatalErrorEncountered: errorExplanations.some((f) => f.isFatal && !f.willRetry),
|
|
117
|
-
currentTime: Date.now(),
|
|
118
|
-
renderSize: 0,
|
|
119
|
-
lambdasInvoked: (_d = overallProgress.lambdasInvoked) !== null && _d !== void 0 ? _d : 0,
|
|
120
|
-
cleanup,
|
|
121
|
-
timeToFinishChunks: null,
|
|
122
|
-
overallProgress: (0, get_overall_progress_1.getOverallProgress)({
|
|
123
|
-
encoding: 0,
|
|
124
|
-
invoking: 0,
|
|
125
|
-
frames: 0,
|
|
126
|
-
gotComposition: overallProgress.compositionValidated,
|
|
127
|
-
visitedServeUrl: overallProgress.serveUrlOpened,
|
|
128
|
-
invokedLambda: overallProgress.lambdasInvoked,
|
|
129
|
-
combining: 0,
|
|
130
|
-
}),
|
|
131
|
-
retriesInfo: (_e = overallProgress.retries) !== null && _e !== void 0 ? _e : [],
|
|
132
|
-
outKey: null,
|
|
133
|
-
outBucket: null,
|
|
134
|
-
mostExpensiveFrameRanges: null,
|
|
135
|
-
timeToEncode: overallProgress.timeToEncode,
|
|
136
|
-
outputSizeInBytes: null,
|
|
137
|
-
estimatedBillingDurationInMilliseconds: null,
|
|
138
|
-
combinedFrames: (_f = overallProgress.combinedFrames) !== null && _f !== void 0 ? _f : 0,
|
|
139
|
-
timeToCombine: (_g = overallProgress.timeToCombine) !== null && _g !== void 0 ? _g : null,
|
|
140
|
-
timeoutTimestamp: overallProgress.timeoutTimestamp,
|
|
141
|
-
type: 'success',
|
|
142
|
-
compositionValidated: overallProgress.compositionValidated,
|
|
143
|
-
functionLaunched: overallProgress.functionLaunched,
|
|
144
|
-
serveUrlOpened: overallProgress.serveUrlOpened,
|
|
145
|
-
artifacts: overallProgress.receivedArtifact,
|
|
146
|
-
};
|
|
147
|
-
}
|
|
148
|
-
const priceFromBucket = (0, calculate_price_from_bucket_1.estimatePriceFromBucket)({
|
|
149
|
-
renderMetadata,
|
|
150
|
-
memorySizeInMb,
|
|
151
|
-
lambdasInvoked: (_h = renderMetadata.estimatedRenderLambdaInvokations) !== null && _h !== void 0 ? _h : 0,
|
|
152
|
-
// We cannot determine the ephemeral storage size, so we
|
|
153
|
-
// overestimate the price, but will only have a miniscule effect (~0.2%)
|
|
154
|
-
diskSizeInMb: constants_1.MAX_EPHEMERAL_STORAGE_IN_MB,
|
|
155
|
-
timings: (_j = overallProgress.timings) !== null && _j !== void 0 ? _j : [],
|
|
156
|
-
region: region,
|
|
157
|
-
});
|
|
158
|
-
const chunkMultiplier = [hasAudio, hasVideo].filter(client_1.truthy).length;
|
|
159
|
-
if (renderMetadata.type === 'still') {
|
|
160
|
-
throw new Error("You don't need to call getRenderProgress() on a still render. Once you have obtained the `renderId`, the render is already done! 😉");
|
|
161
|
-
}
|
|
162
|
-
const allChunks = ((_k = overallProgress.chunks) !== null && _k !== void 0 ? _k : []).length / chunkMultiplier ===
|
|
163
|
-
((_l = renderMetadata.totalChunks) !== null && _l !== void 0 ? _l : Infinity);
|
|
164
|
-
const frameCount = pure_1.NoReactAPIs.getFramesToRender(renderMetadata.frameRange, renderMetadata.everyNthFrame).length;
|
|
165
|
-
const missingChunks = new Array(renderMetadata.totalChunks)
|
|
166
|
-
.fill(true)
|
|
167
|
-
.map((_, i) => i)
|
|
168
|
-
.filter((index) => {
|
|
169
|
-
var _a;
|
|
170
|
-
return (typeof ((_a = overallProgress.chunks) !== null && _a !== void 0 ? _a : []).find((c) => c === index) ===
|
|
171
|
-
'undefined');
|
|
172
|
-
});
|
|
173
|
-
// We add a 20 second buffer for it, since AWS timeshifts can be quite a lot. Once it's 20sec over the limit, we consider it timed out
|
|
174
|
-
// 1. If we have missing chunks, we consider it timed out
|
|
175
|
-
const isBeyondTimeoutAndMissingChunks = Date.now() > renderMetadata.startedDate + timeoutInMilliseconds + 20000 &&
|
|
176
|
-
missingChunks &&
|
|
177
|
-
missingChunks.length > 0;
|
|
178
|
-
// 2. If we have no missing chunks, but the encoding is not done, even after the additional `merge` function has been spawned, we consider it timed out
|
|
179
|
-
const isBeyondTimeoutAndHasStitchTimeout = Date.now() > renderMetadata.startedDate + timeoutInMilliseconds * 2 + 20000;
|
|
180
|
-
const allErrors = [
|
|
181
|
-
isBeyondTimeoutAndMissingChunks || isBeyondTimeoutAndHasStitchTimeout
|
|
182
|
-
? (0, make_timeout_error_1.makeTimeoutError)({
|
|
183
|
-
timeoutInMilliseconds,
|
|
184
|
-
renderMetadata,
|
|
185
|
-
renderId,
|
|
186
|
-
missingChunks: missingChunks !== null && missingChunks !== void 0 ? missingChunks : [],
|
|
187
|
-
region,
|
|
188
|
-
functionName,
|
|
189
|
-
})
|
|
190
|
-
: null,
|
|
191
|
-
...errorExplanations,
|
|
192
|
-
].filter(no_react_1.NoReactInternals.truthy);
|
|
193
|
-
return {
|
|
194
|
-
framesRendered: (_m = overallProgress.framesRendered) !== null && _m !== void 0 ? _m : 0,
|
|
195
|
-
chunks: chunkCount,
|
|
196
|
-
done: false,
|
|
197
|
-
encodingStatus: {
|
|
198
|
-
framesEncoded: overallProgress.framesEncoded,
|
|
199
|
-
combinedFrames: overallProgress.combinedFrames,
|
|
200
|
-
timeToCombine: overallProgress.timeToCombine,
|
|
201
|
-
},
|
|
202
|
-
timeToRenderFrames: overallProgress.timeToRenderFrames,
|
|
203
|
-
costs: priceFromBucket
|
|
204
|
-
? (0, format_costs_info_1.formatCostsInfo)(priceFromBucket.accruedSoFar)
|
|
205
|
-
: (0, format_costs_info_1.formatCostsInfo)(0),
|
|
206
|
-
renderId,
|
|
207
|
-
renderMetadata,
|
|
208
|
-
bucket: bucketName,
|
|
209
|
-
outputFile: null,
|
|
210
|
-
timeToFinish: null,
|
|
211
|
-
errors: allErrors,
|
|
212
|
-
fatalErrorEncountered: allErrors.some((f) => f.isFatal && !f.willRetry),
|
|
213
|
-
currentTime: Date.now(),
|
|
214
|
-
renderSize: 0,
|
|
215
|
-
lambdasInvoked: (_o = overallProgress.lambdasInvoked) !== null && _o !== void 0 ? _o : 0,
|
|
216
|
-
cleanup,
|
|
217
|
-
timeToFinishChunks: allChunks && overallProgress
|
|
218
|
-
? (0, calculate_chunk_times_1.calculateChunkTimes)({
|
|
219
|
-
type: 'absolute-time',
|
|
220
|
-
timings: overallProgress.timings,
|
|
221
|
-
})
|
|
222
|
-
: null,
|
|
223
|
-
overallProgress: (0, get_overall_progress_1.getOverallProgress)({
|
|
224
|
-
encoding: frameCount
|
|
225
|
-
? ((_p = overallProgress.framesEncoded) !== null && _p !== void 0 ? _p : 0) / frameCount
|
|
226
|
-
: 0,
|
|
227
|
-
invoking: ((_q = overallProgress.lambdasInvoked) !== null && _q !== void 0 ? _q : 0) /
|
|
228
|
-
renderMetadata.estimatedRenderLambdaInvokations,
|
|
229
|
-
frames: ((_r = overallProgress.framesRendered) !== null && _r !== void 0 ? _r : 0) / (frameCount !== null && frameCount !== void 0 ? frameCount : 1),
|
|
230
|
-
gotComposition: overallProgress.compositionValidated,
|
|
231
|
-
visitedServeUrl: overallProgress.serveUrlOpened,
|
|
232
|
-
invokedLambda: overallProgress.lambdasInvoked,
|
|
233
|
-
combining: overallProgress.combinedFrames / (frameCount !== null && frameCount !== void 0 ? frameCount : 1),
|
|
234
|
-
}),
|
|
235
|
-
retriesInfo: (_s = overallProgress.retries) !== null && _s !== void 0 ? _s : [],
|
|
236
|
-
outKey: null,
|
|
237
|
-
outBucket: null,
|
|
238
|
-
mostExpensiveFrameRanges: null,
|
|
239
|
-
timeToEncode: overallProgress.timeToEncode,
|
|
240
|
-
outputSizeInBytes: null,
|
|
241
|
-
estimatedBillingDurationInMilliseconds: priceFromBucket
|
|
242
|
-
? priceFromBucket.estimatedBillingDurationInMilliseconds
|
|
243
|
-
: null,
|
|
244
|
-
combinedFrames: (_t = overallProgress.combinedFrames) !== null && _t !== void 0 ? _t : 0,
|
|
245
|
-
timeToCombine: (_u = overallProgress.timeToCombine) !== null && _u !== void 0 ? _u : null,
|
|
246
|
-
timeoutTimestamp: overallProgress.timeoutTimestamp,
|
|
247
|
-
type: 'success',
|
|
248
|
-
compositionValidated: overallProgress.compositionValidated,
|
|
249
|
-
functionLaunched: overallProgress.functionLaunched,
|
|
250
|
-
serveUrlOpened: overallProgress.serveUrlOpened,
|
|
251
|
-
artifacts: overallProgress.receivedArtifact,
|
|
252
|
-
};
|
|
253
|
-
};
|
|
254
|
-
exports.getProgress = getProgress;
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.inspectErrors = void 0;
|
|
4
|
-
const client_1 = require("@remotion/serverless/client");
|
|
5
|
-
const docs_url_1 = require("../../shared/docs-url");
|
|
6
|
-
const FAILED_TO_LAUNCH_TOKEN = 'Failed to launch browser.';
|
|
7
|
-
const getExplanation = (stack) => {
|
|
8
|
-
if (stack.includes('FATAL:zygote_communication_linux.cc')) {
|
|
9
|
-
return (FAILED_TO_LAUNCH_TOKEN +
|
|
10
|
-
' Will be retried - you can probably ignore this error.');
|
|
11
|
-
}
|
|
12
|
-
if (stack.includes('error while loading shared libraries: libnss3.so')) {
|
|
13
|
-
return (FAILED_TO_LAUNCH_TOKEN +
|
|
14
|
-
' Will be retried - you can probably ignore this error.');
|
|
15
|
-
}
|
|
16
|
-
if (stack.includes('TooManyRequestsException')) {
|
|
17
|
-
return `AWS returned an "TooManyRequestsException" error message which could mean you reached the concurrency limit of AWS Lambda. You can increase the limit - read this troubleshooting page: ${docs_url_1.DOCS_URL}/docs/lambda/troubleshooting/rate-limit`;
|
|
18
|
-
}
|
|
19
|
-
if ((0, client_1.errorIsOutOfSpaceError)(stack)) {
|
|
20
|
-
return `Your lambda function reached the storage limit. Reduce the amount of space needed per lambda function or increase the storage limit: ${docs_url_1.DOCS_URL}/docs/lambda/disk-size.`;
|
|
21
|
-
}
|
|
22
|
-
if ((0, client_1.isErrInsufficientResourcesErr)(stack)) {
|
|
23
|
-
return 'The lambda ran out of memory. Deploy a new function with more memory.';
|
|
24
|
-
}
|
|
25
|
-
if ((0, client_1.isBrowserCrashedError)(stack)) {
|
|
26
|
-
return 'The browser crashed while rendering the video. Deploy a new function with memory to give the browser more resources.';
|
|
27
|
-
}
|
|
28
|
-
return null;
|
|
29
|
-
};
|
|
30
|
-
const inspectErrors = ({ errors, }) => {
|
|
31
|
-
return errors.map((e) => {
|
|
32
|
-
return {
|
|
33
|
-
...e,
|
|
34
|
-
explanation: getExplanation(e.stack),
|
|
35
|
-
s3Location: '',
|
|
36
|
-
};
|
|
37
|
-
});
|
|
38
|
-
};
|
|
39
|
-
exports.inspectErrors = inspectErrors;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getWarm = exports.setWarm = void 0;
|
|
4
|
-
let warm = false;
|
|
5
|
-
const setWarm = () => {
|
|
6
|
-
warm = true;
|
|
7
|
-
};
|
|
8
|
-
exports.setWarm = setWarm;
|
|
9
|
-
const getWarm = () => warm;
|
|
10
|
-
exports.getWarm = getWarm;
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import type { NodeIntrospection } from '../../shared/why-is-node-running';
|
|
2
|
-
export declare const stopLeakDetection: () => void;
|
|
3
|
-
export declare const setCurrentRequestId: (awsRequestId: string) => void;
|
|
4
|
-
export declare const startLeakDetection: (leakDetection: NodeIntrospection, awsRequestId: string) => void;
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.startLeakDetection = exports.setCurrentRequestId = exports.stopLeakDetection = void 0;
|
|
4
|
-
const why_is_node_running_1 = require("../../shared/why-is-node-running");
|
|
5
|
-
let currentRequestId = null;
|
|
6
|
-
let leakDetectionTimeout = null;
|
|
7
|
-
const stopLeakDetection = () => {
|
|
8
|
-
if (leakDetectionTimeout !== null) {
|
|
9
|
-
clearTimeout(leakDetectionTimeout.timeout);
|
|
10
|
-
leakDetectionTimeout = null;
|
|
11
|
-
}
|
|
12
|
-
};
|
|
13
|
-
exports.stopLeakDetection = stopLeakDetection;
|
|
14
|
-
const setCurrentRequestId = (awsRequestId) => {
|
|
15
|
-
currentRequestId = awsRequestId;
|
|
16
|
-
};
|
|
17
|
-
exports.setCurrentRequestId = setCurrentRequestId;
|
|
18
|
-
const startLeakDetection = (leakDetection, awsRequestId) => {
|
|
19
|
-
currentRequestId = awsRequestId;
|
|
20
|
-
leakDetectionTimeout = {
|
|
21
|
-
awsRequestId,
|
|
22
|
-
timeout: setTimeout(() => {
|
|
23
|
-
// First allow request ID to be set
|
|
24
|
-
setTimeout(() => {
|
|
25
|
-
if (currentRequestId !== awsRequestId) {
|
|
26
|
-
// New function, all good
|
|
27
|
-
return;
|
|
28
|
-
}
|
|
29
|
-
console.log('Leak detected: Lambda function is still running 10s after the render has finished.');
|
|
30
|
-
console.log('You may report this to the Remotion team.');
|
|
31
|
-
console.log('Include the logs below:');
|
|
32
|
-
(0, why_is_node_running_1.whyIsNodeRunning)(leakDetection);
|
|
33
|
-
console.log('Force-quitting the Lambda function now.');
|
|
34
|
-
process.exit(0);
|
|
35
|
-
}, 100);
|
|
36
|
-
}, 10000),
|
|
37
|
-
};
|
|
38
|
-
leakDetectionTimeout.timeout.unref();
|
|
39
|
-
};
|
|
40
|
-
exports.startLeakDetection = startLeakDetection;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import type { CloudProvider, EnhancedErrorInfo } from '@remotion/serverless';
|
|
2
|
-
import type { RenderMetadata } from '@remotion/serverless/client';
|
|
3
|
-
export declare const makeTimeoutError: <Provider extends CloudProvider>({ timeoutInMilliseconds, missingChunks, renderMetadata, renderId, functionName, region, }: {
|
|
4
|
-
timeoutInMilliseconds: number;
|
|
5
|
-
renderMetadata: RenderMetadata<Provider>;
|
|
6
|
-
renderId: string;
|
|
7
|
-
missingChunks: number[];
|
|
8
|
-
functionName: string;
|
|
9
|
-
region: Provider["region"];
|
|
10
|
-
}) => EnhancedErrorInfo;
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.makeTimeoutError = void 0;
|
|
4
|
-
const make_timeout_message_1 = require("./make-timeout-message");
|
|
5
|
-
const makeTimeoutError = ({ timeoutInMilliseconds, missingChunks, renderMetadata, renderId, functionName, region, }) => {
|
|
6
|
-
const message = (0, make_timeout_message_1.makeTimeoutMessage)({
|
|
7
|
-
missingChunks,
|
|
8
|
-
renderMetadata,
|
|
9
|
-
timeoutInMilliseconds,
|
|
10
|
-
renderId,
|
|
11
|
-
functionName,
|
|
12
|
-
region,
|
|
13
|
-
});
|
|
14
|
-
const error = new Error(message);
|
|
15
|
-
return {
|
|
16
|
-
attempt: 1,
|
|
17
|
-
chunk: null,
|
|
18
|
-
explanation: null,
|
|
19
|
-
frame: null,
|
|
20
|
-
isFatal: true,
|
|
21
|
-
s3Location: '',
|
|
22
|
-
stack: error.stack,
|
|
23
|
-
tmpDir: null,
|
|
24
|
-
totalAttempts: 1,
|
|
25
|
-
type: 'stitcher',
|
|
26
|
-
willRetry: false,
|
|
27
|
-
message,
|
|
28
|
-
name: 'TimeoutError',
|
|
29
|
-
};
|
|
30
|
-
};
|
|
31
|
-
exports.makeTimeoutError = makeTimeoutError;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import type { CloudProvider } from '@remotion/serverless';
|
|
2
|
-
import type { RenderMetadata } from '@remotion/serverless/client';
|
|
3
|
-
export declare const makeTimeoutMessage: <Provider extends CloudProvider>({ timeoutInMilliseconds, missingChunks, renderMetadata, renderId, functionName, region, }: {
|
|
4
|
-
timeoutInMilliseconds: number;
|
|
5
|
-
missingChunks: number[];
|
|
6
|
-
renderMetadata: RenderMetadata<Provider>;
|
|
7
|
-
renderId: string;
|
|
8
|
-
region: Provider["region"];
|
|
9
|
-
functionName: string;
|
|
10
|
-
}) => string;
|
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.makeTimeoutMessage = void 0;
|
|
4
|
-
const client_1 = require("@remotion/serverless/client");
|
|
5
|
-
const docs_url_1 = require("../../shared/docs-url");
|
|
6
|
-
const get_aws_urls_1 = require("../../shared/get-aws-urls");
|
|
7
|
-
const MAX_MISSING_CHUNKS = 5;
|
|
8
|
-
const makeChunkMissingMessage = ({ missingChunks, renderMetadata, region, }) => {
|
|
9
|
-
if (missingChunks.length === 0) {
|
|
10
|
-
return 'All chunks have been successfully rendered, but the main function has timed out.';
|
|
11
|
-
}
|
|
12
|
-
return [
|
|
13
|
-
`The following chunks are missing (showing ${Math.min(MAX_MISSING_CHUNKS, missingChunks.length)} out of ${missingChunks.length}):`,
|
|
14
|
-
...missingChunks
|
|
15
|
-
.map((ch) => {
|
|
16
|
-
const isLastChunk = ch === renderMetadata.totalChunks - 1;
|
|
17
|
-
const start = ch * renderMetadata.framesPerLambda;
|
|
18
|
-
const end = renderMetadata.type === 'still'
|
|
19
|
-
? 0
|
|
20
|
-
: isLastChunk
|
|
21
|
-
? renderMetadata.frameRange[1]
|
|
22
|
-
: (ch + 1) * renderMetadata.framesPerLambda - 1;
|
|
23
|
-
const msg = `Chunk ${ch} (Frames ${start} - ${end})`;
|
|
24
|
-
return [
|
|
25
|
-
msg,
|
|
26
|
-
`▸ Logs for chunk ${ch}: ${(0, get_aws_urls_1.getCloudwatchRendererUrl)({
|
|
27
|
-
functionName: process.env.AWS_LAMBDA_FUNCTION_NAME,
|
|
28
|
-
region: region,
|
|
29
|
-
rendererFunctionName: null,
|
|
30
|
-
renderId: renderMetadata.renderId,
|
|
31
|
-
chunk: ch,
|
|
32
|
-
})}`,
|
|
33
|
-
].join('\n');
|
|
34
|
-
})
|
|
35
|
-
.slice(0, 5),
|
|
36
|
-
].join('\n');
|
|
37
|
-
};
|
|
38
|
-
const makeTimeoutMessage = ({ timeoutInMilliseconds, missingChunks, renderMetadata, renderId, functionName, region, }) => {
|
|
39
|
-
const cloudWatchRendererUrl = (0, get_aws_urls_1.getCloudwatchRendererUrl)({
|
|
40
|
-
renderId,
|
|
41
|
-
functionName,
|
|
42
|
-
region: region,
|
|
43
|
-
rendererFunctionName: functionName,
|
|
44
|
-
chunk: null,
|
|
45
|
-
});
|
|
46
|
-
const cloudWatchLaunchUrl = (0, get_aws_urls_1.getCloudwatchMethodUrl)({
|
|
47
|
-
renderId,
|
|
48
|
-
functionName,
|
|
49
|
-
method: client_1.ServerlessRoutines.launch,
|
|
50
|
-
region: region,
|
|
51
|
-
rendererFunctionName: functionName,
|
|
52
|
-
});
|
|
53
|
-
const message = [
|
|
54
|
-
`The main function timed out after ${timeoutInMilliseconds}ms.`,
|
|
55
|
-
makeChunkMissingMessage({
|
|
56
|
-
missingChunks,
|
|
57
|
-
renderMetadata,
|
|
58
|
-
region,
|
|
59
|
-
}),
|
|
60
|
-
'',
|
|
61
|
-
`Consider increasing the timeout of your function.`,
|
|
62
|
-
`▸ You can use the "--timeout" parameter when deploying a function via CLI, or the "timeoutInSeconds" parameter when using the deployFunction() API.`,
|
|
63
|
-
`${docs_url_1.DOCS_URL}/docs/lambda/cli/functions#deploy`,
|
|
64
|
-
'',
|
|
65
|
-
'▸ Visit the logs for the main function:',
|
|
66
|
-
cloudWatchLaunchUrl,
|
|
67
|
-
'▸ Visit the logs for the renderer functions:',
|
|
68
|
-
cloudWatchRendererUrl,
|
|
69
|
-
'',
|
|
70
|
-
'▸ Get help on debugging this error:',
|
|
71
|
-
`${docs_url_1.DOCS_URL}/docs/lambda/troubleshooting/debug`,
|
|
72
|
-
].join('\n');
|
|
73
|
-
return message;
|
|
74
|
-
};
|
|
75
|
-
exports.makeTimeoutMessage = makeTimeoutMessage;
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import type { AudioCodec, LogLevel } from '@remotion/renderer';
|
|
2
|
-
import type { CloudProvider, ProviderSpecifics } from '@remotion/serverless';
|
|
3
|
-
import type { CustomCredentials, DownloadBehavior, Privacy, RenderMetadata, SerializedInputProps, ServerlessCodec } from '@remotion/serverless/client';
|
|
4
|
-
import type { PostRenderData } from '../../shared/constants';
|
|
5
|
-
import type { OverallProgressHelper } from './overall-render-progress';
|
|
6
|
-
export declare const mergeChunksAndFinishRender: <Provider extends CloudProvider>(options: {
|
|
7
|
-
bucketName: string;
|
|
8
|
-
renderId: string;
|
|
9
|
-
expectedBucketOwner: string;
|
|
10
|
-
numberOfFrames: number;
|
|
11
|
-
codec: ServerlessCodec;
|
|
12
|
-
chunkCount: number;
|
|
13
|
-
fps: number;
|
|
14
|
-
numberOfGifLoops: number | null;
|
|
15
|
-
audioCodec: AudioCodec | null;
|
|
16
|
-
renderBucketName: string;
|
|
17
|
-
customCredentials: CustomCredentials<Provider> | null;
|
|
18
|
-
downloadBehavior: DownloadBehavior;
|
|
19
|
-
key: string;
|
|
20
|
-
privacy: Privacy;
|
|
21
|
-
inputProps: SerializedInputProps;
|
|
22
|
-
serializedResolvedProps: SerializedInputProps;
|
|
23
|
-
renderMetadata: RenderMetadata<Provider>;
|
|
24
|
-
audioBitrate: string | null;
|
|
25
|
-
logLevel: LogLevel;
|
|
26
|
-
framesPerLambda: number;
|
|
27
|
-
binariesDirectory: string | null;
|
|
28
|
-
preferLossless: boolean;
|
|
29
|
-
compositionStart: number;
|
|
30
|
-
outdir: string;
|
|
31
|
-
files: string[];
|
|
32
|
-
overallProgress: OverallProgressHelper<Provider>;
|
|
33
|
-
startTime: number;
|
|
34
|
-
providerSpecifics: ProviderSpecifics<Provider>;
|
|
35
|
-
forcePathStyle: boolean;
|
|
36
|
-
}) => Promise<PostRenderData<Provider>>;
|
|
@@ -1,84 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.mergeChunksAndFinishRender = void 0;
|
|
7
|
-
const fs_1 = __importDefault(require("fs"));
|
|
8
|
-
const cleanup_props_1 = require("./cleanup-props");
|
|
9
|
-
const concat_videos_1 = require("./concat-videos");
|
|
10
|
-
const create_post_render_data_1 = require("./create-post-render-data");
|
|
11
|
-
const get_output_url_from_metadata_1 = require("./get-output-url-from-metadata");
|
|
12
|
-
const inspect_errors_1 = require("./inspect-errors");
|
|
13
|
-
const timer_1 = require("./timer");
|
|
14
|
-
const mergeChunksAndFinishRender = async (options) => {
|
|
15
|
-
const onProgress = (framesEncoded) => {
|
|
16
|
-
options.overallProgress.setCombinedFrames(framesEncoded);
|
|
17
|
-
};
|
|
18
|
-
const encodingStart = Date.now();
|
|
19
|
-
if (options.renderMetadata.type === 'still') {
|
|
20
|
-
throw new Error('Cannot merge stills');
|
|
21
|
-
}
|
|
22
|
-
const { outfile, cleanupChunksProm } = await (0, concat_videos_1.concatVideos)({
|
|
23
|
-
onProgress,
|
|
24
|
-
numberOfFrames: options.numberOfFrames,
|
|
25
|
-
codec: options.codec,
|
|
26
|
-
fps: options.fps,
|
|
27
|
-
numberOfGifLoops: options.numberOfGifLoops,
|
|
28
|
-
files: options.files,
|
|
29
|
-
outdir: options.outdir,
|
|
30
|
-
audioCodec: options.audioCodec,
|
|
31
|
-
audioBitrate: options.audioBitrate,
|
|
32
|
-
logLevel: options.logLevel,
|
|
33
|
-
framesPerLambda: options.framesPerLambda,
|
|
34
|
-
binariesDirectory: options.binariesDirectory,
|
|
35
|
-
cancelSignal: undefined,
|
|
36
|
-
preferLossless: options.preferLossless,
|
|
37
|
-
muted: options.renderMetadata.muted,
|
|
38
|
-
metadata: options.renderMetadata.metadata,
|
|
39
|
-
});
|
|
40
|
-
const encodingStop = Date.now();
|
|
41
|
-
options.overallProgress.setTimeToCombine(encodingStop - encodingStart);
|
|
42
|
-
const outputSize = fs_1.default.statSync(outfile).size;
|
|
43
|
-
const writeToBucket = (0, timer_1.timer)(`Writing to bucket (${outputSize} bytes)`, options.logLevel);
|
|
44
|
-
await options.providerSpecifics.writeFile({
|
|
45
|
-
bucketName: options.renderBucketName,
|
|
46
|
-
key: options.key,
|
|
47
|
-
body: fs_1.default.createReadStream(outfile),
|
|
48
|
-
region: options.providerSpecifics.getCurrentRegionInFunction(),
|
|
49
|
-
privacy: options.privacy,
|
|
50
|
-
expectedBucketOwner: options.expectedBucketOwner,
|
|
51
|
-
downloadBehavior: options.downloadBehavior,
|
|
52
|
-
customCredentials: options.customCredentials,
|
|
53
|
-
forcePathStyle: options.forcePathStyle,
|
|
54
|
-
});
|
|
55
|
-
writeToBucket.end();
|
|
56
|
-
const errorExplanations = (0, inspect_errors_1.inspectErrors)({
|
|
57
|
-
errors: options.overallProgress.get().errors,
|
|
58
|
-
});
|
|
59
|
-
const cleanupProm = (0, cleanup_props_1.cleanupProps)({
|
|
60
|
-
inputProps: options.inputProps,
|
|
61
|
-
serializedResolvedProps: options.serializedResolvedProps,
|
|
62
|
-
providerSpecifics: options.providerSpecifics,
|
|
63
|
-
forcePathStyle: options.forcePathStyle,
|
|
64
|
-
});
|
|
65
|
-
const { url: outputUrl } = (0, get_output_url_from_metadata_1.getOutputUrlFromMetadata)(options.renderMetadata, options.bucketName, options.customCredentials, options.providerSpecifics.getCurrentRegionInFunction());
|
|
66
|
-
const postRenderData = (0, create_post_render_data_1.createPostRenderData)({
|
|
67
|
-
region: options.providerSpecifics.getCurrentRegionInFunction(),
|
|
68
|
-
memorySizeInMb: Number(process.env.AWS_LAMBDA_FUNCTION_MEMORY_SIZE),
|
|
69
|
-
renderMetadata: options.renderMetadata,
|
|
70
|
-
errorExplanations,
|
|
71
|
-
timeToDelete: (await cleanupProm).reduce((a, b) => Math.max(a, b), 0),
|
|
72
|
-
outputFile: {
|
|
73
|
-
url: outputUrl,
|
|
74
|
-
},
|
|
75
|
-
outputSize,
|
|
76
|
-
timeToCombine: encodingStop - encodingStart,
|
|
77
|
-
overallProgress: options.overallProgress.get(),
|
|
78
|
-
timeToFinish: Date.now() - options.startTime,
|
|
79
|
-
});
|
|
80
|
-
options.overallProgress.setPostRenderData(postRenderData);
|
|
81
|
-
await Promise.all([cleanupChunksProm, fs_1.default.promises.rm(outfile)]);
|
|
82
|
-
return postRenderData;
|
|
83
|
-
};
|
|
84
|
-
exports.mergeChunksAndFinishRender = mergeChunksAndFinishRender;
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
// Standard library Math.min and Math.max can throw
|
|
3
|
-
// if array length is very long. Fixing this with own implementation
|
|
4
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
-
exports.max = exports.min = void 0;
|
|
6
|
-
const min = (arr) => {
|
|
7
|
-
if (arr.length === 0) {
|
|
8
|
-
throw new Error('Array of 0 length');
|
|
9
|
-
}
|
|
10
|
-
let smallest = arr[0];
|
|
11
|
-
for (let i = 0; i < arr.length; i++) {
|
|
12
|
-
const elem = arr[i];
|
|
13
|
-
if (elem < smallest) {
|
|
14
|
-
smallest = elem;
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
return smallest;
|
|
18
|
-
};
|
|
19
|
-
exports.min = min;
|
|
20
|
-
const max = (arr) => {
|
|
21
|
-
if (arr.length === 0) {
|
|
22
|
-
throw new Error('Array of 0 length');
|
|
23
|
-
}
|
|
24
|
-
let biggest = arr[0];
|
|
25
|
-
for (let i = 0; i < arr.length; i++) {
|
|
26
|
-
const elem = arr[i];
|
|
27
|
-
if (elem > biggest) {
|
|
28
|
-
biggest = elem;
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
return biggest;
|
|
32
|
-
};
|
|
33
|
-
exports.max = max;
|