fix(backend): 処理に失敗するとidempotentキーを削除してしまいその後のリクエストが通ってしまう問題を修正 (MisskeyIO#591)
This commit is contained in:
parent
92bdc2e054
commit
31ebd77e8a
5 changed files with 79 additions and 8 deletions
|
@ -445,8 +445,8 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
|
|||
createdNote: await this.noteEntityService.pack(note, me),
|
||||
};
|
||||
} catch (err) {
|
||||
// エラーが発生した場合、リクエストの処理結果を削除
|
||||
await this.redisForTimelines.unlink(`note:idempotent:${me.id}:${hash}`);
|
||||
// エラーが発生した場合、まだ処理中として記録されている場合はリクエストの処理結果を削除
|
||||
await this.redisForTimelines.unlinkIf(`note:idempotent:${me.id}:${hash}`, '_');
|
||||
|
||||
logger.error('Failed to create a note.', { error: err });
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue