Sfoglia il codice sorgente

refactor(user-login): remove outdated comment from recordLogin method
fix(rabbitmq-consumer): ensure app crashes on error for immediate notice

Dave 1 mese fa
parent
commit
bc5da963c7

+ 1 - 6
apps/box-stats-api/src/feature/rabbitmq/rabbitmq-consumer.service.ts

@@ -75,12 +75,7 @@ export class RabbitmqConsumerService implements OnModuleInit, OnModuleDestroy {
       // Make sure partial resources get cleaned up.
       await this.safeClose();
 
-      // Choose ONE behavior:
-      // 1) keep app running but consumer disabled:
-      return;
-
-      // 2) OR crash the app so you notice immediately:
-      // throw err;
+      throw err;
     }
   }
 

+ 0 - 4
apps/box-stats-api/src/feature/user-login/user-login.service.ts

@@ -31,10 +31,6 @@ export class UserLoginService {
     throw new Error(`Unsupported loginAt type: ${typeof loginAt}`);
   }
 
-  /**
-   * Record login history in box-stats DB.
-   * NOTE: User model is no longer stored in box-stats.
-   */
   async recordLogin(event: UserLoginEventPayload): Promise<void> {
     const createAt = this.toEpochSecondsBigInt((event as any).loginAt);