Skip to content
Snippets Groups Projects
fluidConfigService.ts 640 B
Newer Older
  • Learn to ignore specific revisions
  • Hugo NOUTS's avatar
    Hugo NOUTS committed
    import Config from '../../config.json'
    import IFluidConfig from './IFluidConfig'
    
    export default class FluidConfig {
      private readonly _fluidConfig: IFluidConfig[]
    
      constructor() {
        this._fluidConfig = Config.fluidConfig
      }
    
      public getFluidConfig(): IFluidConfig[] {
        return this._fluidConfig
      }
    
      /**
       *
       * @param min Minimum hour for cron
       * @param max Maximum hour for cron
       */
    
    CARRON Guilhem's avatar
    CARRON Guilhem committed
      public getCronArgs(min = 8, max = 9): string {
    
        const randomHour = Math.floor(Math.random() * (max - min + 1) + min)
        const randomMinutes = Math.floor(Math.random() * 59)
        return `0 ${randomMinutes} ${randomHour} * * *`
    
    Hugo NOUTS's avatar
    Hugo NOUTS committed
    }