mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-08 07:31:24 +00:00
fix(telegram): clean up update offset on channels remove --delete (#18233)
This commit is contained in:
committed by
Peter Steinberger
parent
b91e43714b
commit
6757a9fedc
@@ -80,3 +80,19 @@ export async function writeTelegramUpdateOffset(params: {
|
||||
await fs.chmod(tmp, 0o600);
|
||||
await fs.rename(tmp, filePath);
|
||||
}
|
||||
|
||||
export async function deleteTelegramUpdateOffset(params: {
|
||||
accountId?: string;
|
||||
env?: NodeJS.ProcessEnv;
|
||||
}): Promise<void> {
|
||||
const filePath = resolveTelegramUpdateOffsetPath(params.accountId, params.env);
|
||||
try {
|
||||
await fs.unlink(filePath);
|
||||
} catch (err) {
|
||||
const code = (err as { code?: string }).code;
|
||||
if (code === "ENOENT") {
|
||||
return;
|
||||
}
|
||||
throw err;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user