bulltrackers-module 1.0.166 → 1.0.167
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.
|
@@ -12,26 +12,15 @@
|
|
|
12
12
|
*/
|
|
13
13
|
|
|
14
14
|
const fs = require('fs');
|
|
15
|
-
//Hacky solution to force tmp writes
|
|
16
|
-
// --- TEMP PATCH START ---
|
|
15
|
+
//Hacky solution to force tmp writes TODO : This Tmp write is really dodgy, not ideal but works, consider less hacky solutions to writing to filesystem
|
|
17
16
|
process.env.TMPDIR = '/tmp';
|
|
18
|
-
process.env.TMP
|
|
19
|
-
process.env.TEMP
|
|
20
|
-
|
|
21
|
-
const os = require('os');
|
|
17
|
+
process.env.TMP = '/tmp';
|
|
18
|
+
process.env.TEMP = '/tmp';
|
|
19
|
+
const os = require('os');
|
|
22
20
|
os.tmpdir = () => '/tmp';
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
const path = require('path');
|
|
27
|
-
const fs = require('fs');
|
|
28
|
-
const tmp = '/tmp';
|
|
29
|
-
if (!fs.existsSync(tmp)) fs.mkdirSync(tmp);
|
|
30
|
-
temp.dir = tmp;
|
|
31
|
-
temp.path = () => path.join(tmp, 'temp-' + Math.random().toString(36).slice(2));
|
|
32
|
-
} catch {}
|
|
33
|
-
// --- TEMP PATCH END ---
|
|
34
|
-
const Viz = require('graphviz'); // Uses your local module
|
|
21
|
+
try { const temp = require('temp'); const path = require('path'); const fs = require('fs'); const tmp = '/tmp';
|
|
22
|
+
if (!fs.existsSync(tmp)) fs.mkdirSync(tmp); temp.dir = tmp; temp.path = () => path.join(tmp, 'temp-' + Math.random().toString(36).slice(2)); } catch {}
|
|
23
|
+
const Viz = require('graphviz');
|
|
35
24
|
|
|
36
25
|
/* --------------------------------------------------
|
|
37
26
|
* Pretty Console Helpers
|
|
@@ -25,10 +25,18 @@ exports.fetchAndStoreInsights = async (config, dependencies) => {
|
|
|
25
25
|
try {
|
|
26
26
|
logger.log('INFO', '[FetchInsightsHelpers] Attempting fetch via proxy manager...');
|
|
27
27
|
response = await proxyManager.fetch(config.etoroInsightsUrl, fetchOptions);
|
|
28
|
+
if (!response.ok) {
|
|
29
|
+
const errorText = await response.text();
|
|
30
|
+
throw new Error(`Proxy request failed with status ${response.status}: ${errorText}`);
|
|
31
|
+
}
|
|
28
32
|
} catch (proxyError) {
|
|
29
33
|
logger.log('WARNING', `[FetchInsightsHelpers] Proxy manager fetch failed. Attempting fallback with node-fetch. Error: ${proxyError.message}`);
|
|
30
34
|
try {
|
|
31
35
|
response = await fetch(config.etoroInsightsUrl, fetchOptions);
|
|
36
|
+
if (!response.ok) {
|
|
37
|
+
const errorText = await response.text();
|
|
38
|
+
throw new Error(`Fallback node-fetch failed with status ${response.status}: ${errorText}`);
|
|
39
|
+
}
|
|
32
40
|
} catch (nodeFetchError) {
|
|
33
41
|
logger.log('ERROR', `[FetchInsightsHelpers] Fallback node-fetch also failed. Error: ${nodeFetchError.message}`);
|
|
34
42
|
throw nodeFetchError; // Throw the error from the last attempt
|