File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff 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 /**
Original file line number Diff line number Diff 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' ) ;
You can’t perform that action at this time.
0 commit comments