Skip to content

Commit

Permalink
hotfix(be): fix count view not work
Browse files Browse the repository at this point in the history
  • Loading branch information
harisato committed Sep 13, 2023
1 parent a3cd510 commit 2ef37cf
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/task/task.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@ export class TasksService {
constructor(
private configService: ConfigService,
private graphqlSvc: GraphqlService,
) {}
) {
this.getViewsReport();
}

// every minute, on the 1st second
@Cron('1 * * * * *')
Expand Down Expand Up @@ -72,7 +74,9 @@ export class TasksService {
const response = await this.runReport();
const env = this.configService.get<string>('app.env');

const subdomain_pattern = env !== '' ? `${env}\.` : '';
const subdomain_pattern = ['dev', 'staging'].includes(env)
? `${env}\.`
: '';

const regex = new RegExp(
`https://${subdomain_pattern}punkga\.me(\/[A-Za-z]+)?\/comic\/[0-9]+\/chapter\/[0-9]+`,
Expand Down

0 comments on commit 2ef37cf

Please sign in to comment.