File tree 1 file changed +8
-2
lines changed
apps/scheduler/src/services
1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -19,7 +19,7 @@ export class AccountRefreshSchedulerService {
19
19
this . processInterrupted = true
20
20
}
21
21
22
- @Interval ( 1000 * 60 * 30 )
22
+ @Interval ( 1000 * 60 * 60 * 3 )
23
23
async scheduleRefreshAccounts ( ) : Promise < void > {
24
24
if ( process . env . NODE_ENV !== 'test' && ! this . processInterrupted ) {
25
25
await this . refreshAccounts ( )
@@ -31,11 +31,17 @@ export class AccountRefreshSchedulerService {
31
31
this . logger . log ( `Refreshing Lens credentials` )
32
32
const fiveDaysAgo = new Date ( )
33
33
fiveDaysAgo . setDate ( fiveDaysAgo . getDate ( ) - 5 )
34
+ const thertyDaysAgo = new Date ( )
35
+ thertyDaysAgo . setDate ( thertyDaysAgo . getDate ( ) - 30 )
34
36
35
37
const lensAccount = await this . integrationAccountService . findOne ( { key : 'lens' } )
36
38
const accounts = await this . accountCredentialsService . find ( {
37
39
integrationAccount : lensAccount ! . _id ,
38
- lastCredentialUpdate : { $exists : true , $lte : fiveDaysAgo } ,
40
+ lastCredentialUpdate : {
41
+ $exists : true ,
42
+ $lte : fiveDaysAgo ,
43
+ $gte : thertyDaysAgo ,
44
+ } ,
39
45
} )
40
46
for ( const account of accounts ) {
41
47
try {
You can’t perform that action at this time.
0 commit comments