Skip to content

Commit 31aa0c0

Browse files
committed
Fix missing crawler timeout config option
1 parent bbf523c commit 31aa0c0

File tree

3 files changed

+7
-1
lines changed

3 files changed

+7
-1
lines changed

config.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,9 @@ import:
6565

6666
# search configuration
6767
search:
68+
# web search connection timeout in milliseconds
69+
timeout: 9000
70+
6871
# caching is required to activate web lenses within search results
6972
# web caching requires 'app.flag.enable_web_source' to be 'true'
7073
web_cache:

src/utils/config.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ async function loadConfig() {
4040
zip_archive: true,
4141
},
4242
search: {
43+
timeout: 9000,
4344
web_cache: {
4445
ttl: 1800,
4546
check: 600,

src/utils/web.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,15 @@ import { Config } from './config.js';
44
import * as DB from './db.js';
55
import * as Util from './helper.js';
66

7-
const crawler = new LensWebCrawler();
87
const Cache = new NodeCache({
98
stdTTL: Config.search.web_cache.ttl,
109
checkperiod: Config.search.web_cache.check,
1110
});
1211

1312
const creatorUrl = Config.search.creator_url;
13+
const searchTimeout = Config.search.timeout;
14+
15+
const crawler = new LensWebCrawler(searchTimeout);
1416

1517
async function search(searchTerm) {
1618
let result = [];

0 commit comments

Comments
 (0)