-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor sync sub status and throttle (#5734)
- Rename syncSubStatus to syncStage - Rename ongoingSyncStartedAt to syncStageStartedAt - Remove throttlePauseUntil from db and compute it with syncStageStartedAt and throttleFailureCount
- Loading branch information
1 parent
ce1469c
commit 234e062
Showing
14 changed files
with
148 additions
and
110 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
import { EntityManager } from 'typeorm'; | ||
|
||
import { DEV_SEED_CONNECTED_ACCOUNT_IDS } from 'src/database/typeorm-seeds/workspace/connected-account'; | ||
import { MessageChannelSyncSubStatus } from 'src/modules/messaging/common/standard-objects/message-channel.workspace-entity'; | ||
import { MessageChannelSyncStage } from 'src/modules/messaging/common/standard-objects/message-channel.workspace-entity'; | ||
|
||
const tableName = 'messageChannel'; | ||
|
||
|
@@ -28,7 +28,7 @@ export const seedMessageChannel = async ( | |
'connectedAccountId', | ||
'handle', | ||
'visibility', | ||
'syncSubStatus', | ||
'syncStage', | ||
]) | ||
.orIgnore() | ||
.values([ | ||
|
@@ -42,8 +42,7 @@ export const seedMessageChannel = async ( | |
connectedAccountId: DEV_SEED_CONNECTED_ACCOUNT_IDS.TIM, | ||
handle: '[email protected]', | ||
visibility: 'share_everything', | ||
syncSubStatus: | ||
MessageChannelSyncSubStatus.FULL_MESSAGE_LIST_FETCH_PENDING, | ||
syncStage: MessageChannelSyncStage.FULL_MESSAGE_LIST_FETCH_PENDING, | ||
}, | ||
{ | ||
id: DEV_SEED_MESSAGE_CHANNEL_IDS.JONY, | ||
|
@@ -55,8 +54,7 @@ export const seedMessageChannel = async ( | |
connectedAccountId: DEV_SEED_CONNECTED_ACCOUNT_IDS.JONY, | ||
handle: '[email protected]', | ||
visibility: 'share_everything', | ||
syncSubStatus: | ||
MessageChannelSyncSubStatus.FULL_MESSAGE_LIST_FETCH_PENDING, | ||
syncStage: MessageChannelSyncStage.FULL_MESSAGE_LIST_FETCH_PENDING, | ||
}, | ||
{ | ||
id: DEV_SEED_MESSAGE_CHANNEL_IDS.PHIL, | ||
|
@@ -68,8 +66,7 @@ export const seedMessageChannel = async ( | |
connectedAccountId: DEV_SEED_CONNECTED_ACCOUNT_IDS.PHIL, | ||
handle: '[email protected]', | ||
visibility: 'share_everything', | ||
syncSubStatus: | ||
MessageChannelSyncSubStatus.FULL_MESSAGE_LIST_FETCH_PENDING, | ||
syncStage: MessageChannelSyncStage.FULL_MESSAGE_LIST_FETCH_PENDING, | ||
}, | ||
]) | ||
.execute(); | ||
|
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
Oops, something went wrong.