Skip to content

Commit

Permalink
use config
Browse files Browse the repository at this point in the history
  • Loading branch information
JulienMattiussi committed Oct 25, 2023
1 parent 85731e4 commit 80d3251
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
8 changes: 4 additions & 4 deletions config.json
Original file line number Diff line number Diff line change
Expand Up @@ -188,8 +188,8 @@
"dataset": 60,
"search": 200
},
"multilingual": false,
"webServiceBaseURL": "https://data-computer.services.istex.fr/v1/",
"ISOLATED_MODE": false
}
"multilingual": false
},
"webServiceBaseURL": "https://data-computer.services.istex.fr/v1/",
"ISOLATED_MODE": true
}
7 changes: 4 additions & 3 deletions src/api/services/precomputed/precomputed.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@ import tar from 'tar-stream';
import fs from 'fs';
import { pipeline } from 'stream';
import { promisify } from 'util';

const ISOLATED_MODE = localConfig.ISOLATED_MODE;

import {
PENDING as PRECOMPUTED_PENDING,
IN_PROGRESS,
Expand All @@ -29,6 +26,7 @@ const webhookBaseUrl =
: baseUrl;

const { precomputedBatchSize: BATCH_SIZE = 10 } = localConfig;
const { ISOLATED_MODE = true } = localConfig;

export const getPrecomputedDataPreview = async ctx => {
const { sourceColumns } = ctx.request.body;
Expand Down Expand Up @@ -132,7 +130,10 @@ export const getTokenFromWebservice = async (
jobId,
) => {
if (ISOLATED_MODE) {
console.warn('*** ISOLATED_MODE activated ***');
return { id: 'treeSegment', value: '12345' };
} else {
console.warn('--- ISOLATED_MODE disabled ---');
}

const response = await fetch(webServiceUrl, {
Expand Down

0 comments on commit 80d3251

Please sign in to comment.