Skip to content

Commit

Permalink
feat: conditioned random statuses
Browse files Browse the repository at this point in the history
  • Loading branch information
illfixit committed Aug 21, 2024
1 parent 50ffb24 commit 7344d23
Showing 1 changed file with 8 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,16 +31,19 @@ import {fakeEnv} from './fake-environments';
import {TEST_ORGANIZATIONS} from './fake-organizations';
import {getUserInfo} from './fake-users';

const ACTIVATE_RANDOM_STATUSES: boolean = false;

const getRandomStatus = (): ConnectorStatusDto => {
const statuses: ConnectorStatusDto[] = ['ONLINE', 'OFFLINE', 'INIT'];
return statuses[Math.floor(Math.random() * statuses.length)];
};

setInterval(() => {
TEST_CONNECTORS.forEach((c) => {
c.status = getRandomStatus();
});
}, 5000);
if (ACTIVATE_RANDOM_STATUSES)
setInterval(() => {
TEST_CONNECTORS.forEach((c) => {
c.status = getRandomStatus();
});
}, 20000);

export let TEST_CONNECTORS: ConnectorDetailDto[] = [
{
Expand Down

0 comments on commit 7344d23

Please sign in to comment.