mirror of
				https://github.com/Unleash/unleash.git
				synced 2025-10-27 11:02:16 +01:00 
			
		
		
		
	chore: remove schedulers (#5895)
This commit is contained in:
		
							parent
							
								
									1c84a81178
								
							
						
					
					
						commit
						3e186f1986
					
				| @ -29,6 +29,7 @@ exports[`should create default config 1`] = ` | ||||
|     "enabled": true, | ||||
|     "maxAge": 3600000, | ||||
|   }, | ||||
|   "dailyMetricsStorageDays": 31, | ||||
|   "db": { | ||||
|     "acquireConnectionTimeout": 30000, | ||||
|     "applicationName": "unleash", | ||||
|  | ||||
| @ -551,6 +551,11 @@ export function createConfig(options: IUnleashOptions): IUnleashConfig { | ||||
| 
 | ||||
|     const feedbackUriPath = process.env.FEEDBACK_URI_PATH; | ||||
| 
 | ||||
|     const dailyMetricsStorageDays = Math.min( | ||||
|         parseEnvVarNumber(process.env.DAILY_METRICS_STORAGE_DAYS, 31), | ||||
|         92, | ||||
|     ); | ||||
| 
 | ||||
|     return { | ||||
|         db, | ||||
|         session, | ||||
| @ -587,6 +592,7 @@ export function createConfig(options: IUnleashOptions): IUnleashConfig { | ||||
|         metricsRateLimiting, | ||||
|         rateLimiting, | ||||
|         feedbackUriPath, | ||||
|         dailyMetricsStorageDays, | ||||
|     }; | ||||
| } | ||||
| 
 | ||||
|  | ||||
| @ -145,22 +145,6 @@ export const scheduleServices = async ( | ||||
|         'clearMetrics', | ||||
|     ); | ||||
| 
 | ||||
|     schedulerService.schedule( | ||||
|         () => { | ||||
|             clientMetricsServiceV2.clearDailyMetrics(92).catch(console.error); | ||||
|         }, | ||||
|         hoursToMilliseconds(24), | ||||
|         'clearDailyMetrics', | ||||
|     ); | ||||
| 
 | ||||
|     schedulerService.schedule( | ||||
|         () => { | ||||
|             clientMetricsServiceV2.aggregateDailyMetrics().catch(console.error); | ||||
|         }, | ||||
|         hoursToMilliseconds(24), | ||||
|         'aggregateDailyMetrics', | ||||
|     ); | ||||
| 
 | ||||
|     schedulerService.schedule( | ||||
|         accountService.updateLastSeen.bind(accountService), | ||||
|         minutesToMilliseconds(3), | ||||
|  | ||||
| @ -133,6 +133,7 @@ export interface IUnleashOptions { | ||||
|     publicFolder?: string; | ||||
|     disableScheduler?: boolean; | ||||
|     metricsRateLimiting?: Partial<IMetricsRateLimiting>; | ||||
|     dailyMetricsStorageDays?: number; | ||||
|     rateLimiting?: Partial<IRateLimiting>; | ||||
| } | ||||
| 
 | ||||
| @ -236,6 +237,7 @@ export interface IUnleashConfig { | ||||
|     segmentValuesLimit: number; | ||||
|     strategySegmentsLimit: number; | ||||
|     metricsRateLimiting: IMetricsRateLimiting; | ||||
|     dailyMetricsStorageDays: number; | ||||
|     clientFeatureCaching: IClientCachingOption; | ||||
|     accessControlMaxAge: number; | ||||
|     prometheusApi?: string; | ||||
|  | ||||
		Loading…
	
		Reference in New Issue
	
	Block a user