fix: resolve lint errors - unused parameters and type safety
This commit is contained in:
parent
0639c7bf1f
commit
a4cccc2231
1
openclaw
Submodule
1
openclaw
Submodule
@ -0,0 +1 @@
|
|||||||
|
Subproject commit 0639c7bf1f37bafeb847afc9e422f05f3bb084a3
|
||||||
@ -10,8 +10,9 @@ export async function writeOAuthCredentials(
|
|||||||
agentDir?: string,
|
agentDir?: string,
|
||||||
): Promise<void> {
|
): Promise<void> {
|
||||||
// Write to resolved agent dir so gateway finds credentials on startup.
|
// Write to resolved agent dir so gateway finds credentials on startup.
|
||||||
|
const emailStr = typeof creds.email === "string" ? creds.email : "default";
|
||||||
upsertAuthProfile({
|
upsertAuthProfile({
|
||||||
profileId: `${provider}:${creds.email ?? "default"}`,
|
profileId: `${provider}:${emailStr}`,
|
||||||
credential: {
|
credential: {
|
||||||
type: "oauth",
|
type: "oauth",
|
||||||
provider,
|
provider,
|
||||||
|
|||||||
@ -150,7 +150,7 @@ export async function startGatewayServer(
|
|||||||
): Promise<GatewayServer> {
|
): Promise<GatewayServer> {
|
||||||
// Install global unhandled rejection handler to prevent gateway crashes
|
// Install global unhandled rejection handler to prevent gateway crashes
|
||||||
// from background promises (e.g., Telegram polling, network operations)
|
// from background promises (e.g., Telegram polling, network operations)
|
||||||
const handleUnhandledRejection = (reason: unknown, promise: Promise<unknown>) => {
|
const handleUnhandledRejection = (reason: unknown, _promise: Promise<unknown>) => {
|
||||||
const formatted = reason instanceof Error ? reason.message : String(reason);
|
const formatted = reason instanceof Error ? reason.message : String(reason);
|
||||||
log.error(`unhandled promise rejection: ${formatted}`);
|
log.error(`unhandled promise rejection: ${formatted}`);
|
||||||
// Log additional details for debugging
|
// Log additional details for debugging
|
||||||
@ -587,7 +587,7 @@ export async function startGatewayServer(
|
|||||||
close: async (opts) => {
|
close: async (opts) => {
|
||||||
// Remove unhandled rejection handler on shutdown
|
// Remove unhandled rejection handler on shutdown
|
||||||
process.off("unhandledRejection", handleUnhandledRejection);
|
process.off("unhandledRejection", handleUnhandledRejection);
|
||||||
|
|
||||||
if (diagnosticsEnabled) {
|
if (diagnosticsEnabled) {
|
||||||
stopDiagnosticHeartbeat();
|
stopDiagnosticHeartbeat();
|
||||||
}
|
}
|
||||||
|
|||||||
@ -202,7 +202,7 @@ export async function monitorTelegramProvider(opts: MonitorTelegramOpts = {}) {
|
|||||||
// Ensure runner is stopped to prevent lingering promises
|
// Ensure runner is stopped to prevent lingering promises
|
||||||
try {
|
try {
|
||||||
await runner.stop();
|
await runner.stop();
|
||||||
} catch (stopErr) {
|
} catch {
|
||||||
// Suppress errors from runner.stop() in finally block
|
// Suppress errors from runner.stop() in finally block
|
||||||
// (already logged by stopOnAbort if abort-triggered)
|
// (already logged by stopOnAbort if abort-triggered)
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user