Skip to content

Commit 6fe0d8d

Browse files
committed
chore(limiter): logs for block workspace
1 parent 2cfc8fe commit 6fe0d8d

2 files changed

Lines changed: 8 additions & 1 deletion

File tree

workers/limiter/src/dbHelper.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,14 +116,16 @@ export class DbHelper {
116116
* @param isBlocked - new isBlocked state of the workspace
117117
*/
118118
public async changeWorkspaceBlockedState(workspaceId: string, isBlocked: boolean): Promise<void> {
119-
await this.workspacesCollection.updateOne(
119+
const result = await this.workspacesCollection.updateOne(
120120
{ _id: new ObjectId(workspaceId) },
121121
{
122122
$set: {
123123
isBlocked,
124124
},
125125
}
126126
);
127+
128+
console.log('result of changeWorkspaceBlockedState', JSON.stringify(result));
127129
}
128130

129131
/**

workers/limiter/src/index.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,8 @@ export default class LimiterWorker extends Worker {
108108
* @param event - event to handle
109109
*/
110110
private async handleBlockWorkspaceEvent(event: BlockWorkspaceEvent): Promise<void> {
111+
this.logger.info('handle block workspace event', event);
112+
111113
const workspace = await this.dbHelper.getWorkspacesWithTariffPlans(event.workspaceId);
112114

113115
if (!workspace) {
@@ -127,6 +129,9 @@ export default class LimiterWorker extends Worker {
127129
const projectIds = workspaceProjects.map(project => project._id.toString());
128130

129131
await this.dbHelper.changeWorkspaceBlockedState(event.workspaceId, true);
132+
133+
this.logger.info('workspace blocked in db ', event.workspaceId)
134+
130135
await this.redis.appendBannedProjects(projectIds);
131136

132137
this.sendSingleWorkspaceReport(workspaceProjects, workspace, 'blocked');

0 commit comments

Comments
 (0)