頻繁にAPリクエストが発生するサーバーに対してfetchInstanceMetadata手動更新が無視される問題を修正 (MisskeyIO#194)
This commit is contained in:
parent
239d9a4c81
commit
42bc2817be
2 changed files with 7 additions and 6 deletions
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue