@arela/uploader 1.0.0 → 1.0.2
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/package.json
CHANGED
package/src/config/config.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { config } from 'dotenv';
|
|
2
2
|
import fs from 'fs';
|
|
3
3
|
import path from 'path';
|
|
4
|
+
import { fileURLToPath } from 'url';
|
|
4
5
|
|
|
5
6
|
config();
|
|
6
7
|
|
|
@@ -25,14 +26,14 @@ class Config {
|
|
|
25
26
|
*/
|
|
26
27
|
#loadPackageVersion() {
|
|
27
28
|
try {
|
|
28
|
-
const __filename =
|
|
29
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
29
30
|
const __dirname = path.dirname(__filename);
|
|
30
31
|
const packageJsonPath = path.resolve(__dirname, '../../package.json');
|
|
31
32
|
const packageJson = JSON.parse(fs.readFileSync(packageJsonPath, 'utf-8'));
|
|
32
|
-
return packageJson.version || '0.2
|
|
33
|
+
return packageJson.version || '1.0.2';
|
|
33
34
|
} catch (error) {
|
|
34
35
|
console.warn('⚠️ Could not read package.json version, using fallback');
|
|
35
|
-
return '0.2
|
|
36
|
+
return '1.0.2';
|
|
36
37
|
}
|
|
37
38
|
}
|
|
38
39
|
|
|
@@ -498,8 +498,8 @@ export class DatabaseService {
|
|
|
498
498
|
);
|
|
499
499
|
|
|
500
500
|
const processingBatchSize = parseInt(options.batchSize) || 10;
|
|
501
|
-
//
|
|
502
|
-
const queryBatchSize = 100;
|
|
501
|
+
// Query batch size for each API call
|
|
502
|
+
const queryBatchSize = 100;
|
|
503
503
|
|
|
504
504
|
let totalDetected = 0;
|
|
505
505
|
let totalProcessed = 0;
|
|
@@ -397,6 +397,15 @@ export class ApiUploadService extends BaseUploadService {
|
|
|
397
397
|
|
|
398
398
|
try {
|
|
399
399
|
const isHttps = this.baseUrl.startsWith('https');
|
|
400
|
+
|
|
401
|
+
// Longer timeout for propagation (can take several minutes for large datasets)
|
|
402
|
+
const propagationTimeout = 5 * 60 * 1000; // 5 minutes
|
|
403
|
+
const controller = new AbortController();
|
|
404
|
+
const timeoutId = setTimeout(
|
|
405
|
+
() => controller.abort(),
|
|
406
|
+
propagationTimeout,
|
|
407
|
+
);
|
|
408
|
+
|
|
400
409
|
const response = await fetch(
|
|
401
410
|
`${this.baseUrl}/api/uploader/propagate-arela-path`,
|
|
402
411
|
{
|
|
@@ -407,9 +416,12 @@ export class ApiUploadService extends BaseUploadService {
|
|
|
407
416
|
},
|
|
408
417
|
body: JSON.stringify({ years }),
|
|
409
418
|
agent: isHttps ? this.httpsAgent : this.httpAgent,
|
|
419
|
+
signal: controller.signal,
|
|
410
420
|
},
|
|
411
421
|
);
|
|
412
422
|
|
|
423
|
+
clearTimeout(timeoutId);
|
|
424
|
+
|
|
413
425
|
if (!response.ok) {
|
|
414
426
|
const errorText = await response.text();
|
|
415
427
|
throw new Error(
|