-
Notifications
You must be signed in to change notification settings - Fork 578
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: export health service and support mongoose health check (#3569)
* chore: export midway health service * feat: add mongoose health check * feat: add mongoose health check * fix: test * fix: test
- Loading branch information
1 parent
30caff5
commit c3dd094
Showing
23 changed files
with
179 additions
and
156 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 18 additions & 3 deletions
21
packages/cache-manager-redis/src/store.ts → packages/cache-manager/src/store.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
import { Provide, Scope } from '../decorator'; | ||
import { ScopeEnum } from '../interface'; | ||
|
||
export const DEFAULT_PRIORITY = { | ||
L1: 'High', | ||
L2: 'Medium', | ||
L3: 'Low', | ||
}; | ||
|
||
@Provide() | ||
@Scope(ScopeEnum.Singleton) | ||
export class MidwayPriorityManager { | ||
private priorityList: Record<string, string> = DEFAULT_PRIORITY; | ||
private defaultPriority = DEFAULT_PRIORITY.L2; | ||
|
||
public getCurrentPriorityList() { | ||
return this.priorityList; | ||
} | ||
|
||
public getDefaultPriority(): string { | ||
return this.defaultPriority; | ||
} | ||
|
||
public isHighPriority(priority = DEFAULT_PRIORITY.L2) { | ||
return priority === DEFAULT_PRIORITY.L1; | ||
} | ||
public isMediumPriority(priority = DEFAULT_PRIORITY.L2) { | ||
return priority === DEFAULT_PRIORITY.L2; | ||
} | ||
public isLowPriority(priority = DEFAULT_PRIORITY.L2) { | ||
return priority === DEFAULT_PRIORITY.L3; | ||
} | ||
|
||
public getPriority(priority: string) { | ||
return priority || this.getDefaultPriority(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.