Skip to content

Commit

Permalink
Merge pull request #840 from Sanofi-IADC/feature/WEB-2246-tags
Browse files Browse the repository at this point in the history
fix: WEB-2246 remove reading primary replica
  • Loading branch information
sairam459 committed Jun 4, 2024
2 parents cc96272 + 8d022db commit 41bafad
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 10 deletions.
3 changes: 1 addition & 2 deletions src/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ import { TagModule } from './tag/tag.module';
import { HealthController } from './health/health.controller';
import { AuthModule } from './auth/auth.module';
import { GqlContext } from './auth/gql-context';
import { DatabaseService } from './common/DatabaseService';

@Module({
imports: [
Expand Down Expand Up @@ -92,7 +91,7 @@ import { DatabaseService } from './common/DatabaseService';
WebhookModule,
AuthModule,
],
providers: [AppService, DatabaseService],
providers: [AppService],
controllers: [AppController, HealthController],
})
export class AppModule {}
6 changes: 0 additions & 6 deletions src/config/config.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,12 +73,6 @@ export class ConfigService {
readPreference: this.get('REPLICASET') !== undefined ? readPreference : null,
user: this.get('MONGOOSE_USERNAME'),
pass: this.get('MONGOOSE_PASSWORD'),
maxPoolSize: this.get('MONGOOSE_POOL_SIZE')
? parseInt(this.get('MONGOOSE_POOL_SIZE'), 10)
: 20,
retryAttempts: 2,
connectTimeoutMS: 60000,
socketTimeoutMS: 60000,
};
if (this.get('SSL_VALIDATE') === true) {
options = {
Expand Down
2 changes: 0 additions & 2 deletions src/whisp/whisp.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -128,8 +128,6 @@ export class WhispService {

async findTagsByWhispId(whispId: string): Promise<TagInputType[]> {
const query = this.whispModel.findById(whispId).populate('tags');
// To avoid using secondary node which is set by default to overcome data inconsistencies
query.read('primaryPreferred');
const whisps = await query.exec();
return whisps.tags;
}
Expand Down

0 comments on commit 41bafad

Please sign in to comment.