頻繁にAPリクエストが発生するサーバーに対してfetchInstanceMetadata手動更新が無視される問題を修正 (MisskeyIO#194)

This commit is contained in:
まっちゃとーにゅ 2023-10-29 09:40:48 +09:00 committed by GitHub
parent 239d9a4c81
commit 42bc2817be
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 6 deletions

View file

@ -23,9 +23,10 @@ import type { MockFunctionMetadata } from 'jest-mock';
function mockRedis() {
const hash = {};
const set = jest.fn((key, value) => {
const ret = hash[key];
// このテストで呼び出すSETにはNXオプションが付いてる
if (hash[key]) return null;
hash[key] = value;
return ret;
return 'OK';
});
return set;
}