-
Notifications
You must be signed in to change notification settings - Fork 10.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: move db calls to model definition
- Loading branch information
1 parent
d71f267
commit 9661ea3
Showing
6 changed files
with
81 additions
and
84 deletions.
There are no files selected for viewing
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
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 |
---|---|---|
@@ -1,10 +1,13 @@ | ||
import type { IInstanceStatus } from '@rocket.chat/core-typings'; | ||
import type { UpdateResult } from 'mongodb'; | ||
import type { DeleteResult, ModifyResult, UpdateResult } from 'mongodb'; | ||
|
||
import type { IBaseModel } from './IBaseModel'; | ||
|
||
export interface IInstanceStatusModel extends IBaseModel<IInstanceStatus> { | ||
getActiveInstanceCount(): Promise<number>; | ||
getActiveInstancesAddress(): Promise<string[]>; | ||
removeInstanceById(_id: IInstanceStatus['_id']): Promise<DeleteResult>; | ||
setDocumentHeartbeat(documentId: string): Promise<UpdateResult>; | ||
upsertInstance(instance: Partial<IInstanceStatus>): Promise<ModifyResult<IInstanceStatus>>; | ||
updateConnections(_id: IInstanceStatus['_id'], conns: number): Promise<UpdateResult>; | ||
} |