Skip to content
Snippets Groups Projects
Commit c7587340 authored by CARRON Guilhem's avatar CARRON Guilhem
Browse files

WIP: test random cron

parent af576142
No related branches found
No related tags found
3 merge requests!103Support,!102Dev,!72features/US182_triggers_planning
...@@ -3,6 +3,7 @@ import { translate } from 'cozy-ui/react/I18n' ...@@ -3,6 +3,7 @@ import { translate } from 'cozy-ui/react/I18n'
import { AppContext } from 'components/Contexts/AppContextProvider' import { AppContext } from 'components/Contexts/AppContextProvider'
import UserProfileManager from 'services/userProfileDataManagerService' import UserProfileManager from 'services/userProfileDataManagerService'
import { Client, withClient } from 'cozy-client' import { Client, withClient } from 'cozy-client'
import KonnectorStatusService from 'services/konnectorStatusService'
interface ReportProps { interface ReportProps {
t: Function t: Function
...@@ -24,6 +25,8 @@ const Report: React.FC<ReportProps> = ({ t, client }: ReportProps) => { ...@@ -24,6 +25,8 @@ const Report: React.FC<ReportProps> = ({ t, client }: ReportProps) => {
updatedUserProfile(e.target.value) updatedUserProfile(e.target.value)
} }
const kss = new KonnectorStatusService(client)
console.log(kss.getAllTriggers())
return ( return (
<div className="report-root"> <div className="report-root">
<div className="report-content"> <div className="report-content">
......
...@@ -17,7 +17,7 @@ export default class FluidConfig { ...@@ -17,7 +17,7 @@ export default class FluidConfig {
* @param min Minimum hour for cron * @param min Minimum hour for cron
* @param max Maximum hour for cron * @param max Maximum hour for cron
*/ */
public getCronArgs(min = 8, max = 10): string { public getCronArgs(min = 8, max = 9): string {
const randomHour = Math.floor(Math.random() * (max - min + 1) + min) const randomHour = Math.floor(Math.random() * (max - min + 1) + min)
const randomMinutes = Math.floor(Math.random() * 59) const randomMinutes = Math.floor(Math.random() * 59)
return `0 ${randomMinutes} ${randomHour} * * *` return `0 ${randomMinutes} ${randomHour} * * *`
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment