removed process.env
This commit is contained in:
parent
b501d7a2da
commit
1f190b1068
1 changed files with 5 additions and 7 deletions
|
|
@ -99,18 +99,16 @@ async function fetchProxiesFromWebShare(): Promise<string[] | null> {
|
||||||
const { getConfig } = await import('@stock-bot/config');
|
const { getConfig } = await import('@stock-bot/config');
|
||||||
const config = getConfig();
|
const config = getConfig();
|
||||||
|
|
||||||
// Try environment variables first, then fall back to config
|
// Get configuration from config system
|
||||||
const apiKey = process.env.WEBSHARE_API_KEY || config.webshare?.apiKey;
|
const apiKey = config.webshare?.apiKey;
|
||||||
const apiUrl = process.env.WEBSHARE_API_URL || config.webshare?.apiUrl;
|
const apiUrl = config.webshare?.apiUrl;
|
||||||
|
|
||||||
if (!apiKey || !apiUrl) {
|
if (!apiKey || !apiUrl) {
|
||||||
logger.error('Missing WebShare configuration', {
|
logger.error('Missing WebShare configuration', {
|
||||||
hasApiKey: !!apiKey,
|
hasApiKey: !!apiKey,
|
||||||
hasApiUrl: !!apiUrl,
|
hasApiUrl: !!apiUrl,
|
||||||
envApiKey: process.env.WEBSHARE_API_KEY?.substring(0, 10) + '...',
|
configApiKey: apiKey?.substring(0, 10) + '...',
|
||||||
envApiUrl: process.env.WEBSHARE_API_URL,
|
configApiUrl: apiUrl,
|
||||||
configApiKey: config.webshare?.apiKey?.substring(0, 10) + '...',
|
|
||||||
configApiUrl: config.webshare?.apiUrl,
|
|
||||||
});
|
});
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue