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 config = getConfig();
|
||||
|
||||
// Try environment variables first, then fall back to config
|
||||
const apiKey = process.env.WEBSHARE_API_KEY || config.webshare?.apiKey;
|
||||
const apiUrl = process.env.WEBSHARE_API_URL || config.webshare?.apiUrl;
|
||||
// Get configuration from config system
|
||||
const apiKey = config.webshare?.apiKey;
|
||||
const apiUrl = config.webshare?.apiUrl;
|
||||
|
||||
if (!apiKey || !apiUrl) {
|
||||
logger.error('Missing WebShare configuration', {
|
||||
hasApiKey: !!apiKey,
|
||||
hasApiUrl: !!apiUrl,
|
||||
envApiKey: process.env.WEBSHARE_API_KEY?.substring(0, 10) + '...',
|
||||
envApiUrl: process.env.WEBSHARE_API_URL,
|
||||
configApiKey: config.webshare?.apiKey?.substring(0, 10) + '...',
|
||||
configApiUrl: config.webshare?.apiUrl,
|
||||
configApiKey: apiKey?.substring(0, 10) + '...',
|
||||
configApiUrl: apiUrl,
|
||||
});
|
||||
return null;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue