mirror of
https://github.com/diegosouzapw/OmniRoute.git
synced 2026-07-31 04:12:10 +03:00
fix(healthcheck): apply proxy resolution per connection in sweeping loop (#1051)
This commit is contained in:
@@ -10,7 +10,7 @@
|
||||
* updates the DB, and logs the result.
|
||||
*/
|
||||
|
||||
import { getProviderConnections, updateProviderConnection, getSettings } from "@/lib/localDb";
|
||||
import { getProviderConnections, updateProviderConnection, getSettings, resolveProxyForConnection } from "@/lib/localDb";
|
||||
import {
|
||||
getAccessToken,
|
||||
supportsTokenRefresh,
|
||||
@@ -228,17 +228,23 @@ async function checkConnection(conn) {
|
||||
};
|
||||
|
||||
const hideLogs = await shouldHideLogs();
|
||||
const result = await getAccessToken(conn.provider, credentials, {
|
||||
info: (tag, msg) => {
|
||||
if (!hideLogs) console.log(`${LOG_PREFIX} [${tag}] ${msg}`);
|
||||
const proxyConfig = await resolveProxyForConnection(conn.id);
|
||||
const result = await getAccessToken(
|
||||
conn.provider,
|
||||
credentials,
|
||||
{
|
||||
info: (tag, msg) => {
|
||||
if (!hideLogs) console.log(`${LOG_PREFIX} [${tag}] ${msg}`);
|
||||
},
|
||||
warn: (tag, msg) => {
|
||||
if (!hideLogs) console.warn(`${LOG_PREFIX} [${tag}] ${msg}`);
|
||||
},
|
||||
error: (tag, msg, extra) => {
|
||||
if (!hideLogs) console.error(`${LOG_PREFIX} [${tag}] ${msg}`, extra || "");
|
||||
},
|
||||
},
|
||||
warn: (tag, msg) => {
|
||||
if (!hideLogs) console.warn(`${LOG_PREFIX} [${tag}] ${msg}`);
|
||||
},
|
||||
error: (tag, msg, extra) => {
|
||||
if (!hideLogs) console.error(`${LOG_PREFIX} [${tag}] ${msg}`, extra || "");
|
||||
},
|
||||
});
|
||||
proxyConfig
|
||||
);
|
||||
|
||||
const now = new Date().toISOString();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user