move enabled check before schedule check

Signed-off-by: Dominik Pfaffenbauer <dominik@pfaffenbauer.at>
This commit is contained in:
Dominik Pfaffenbauer
2023-01-23 12:22:38 +01:00
parent 2d60f01e2a
commit 42ac2ad34c
@@ -78,6 +78,11 @@ export class GitlabOrgDiscoveryEntityProvider implements EntityProvider {
providerConfigs.forEach(providerConfig => {
const integration = integrations.byHost(providerConfig.host);
if (!providerConfig.orgEnabled) {
return;
}
if (!integration) {
throw new Error(
`No gitlab integration found that matches host ${providerConfig.host}`,
@@ -90,10 +95,6 @@ export class GitlabOrgDiscoveryEntityProvider implements EntityProvider {
);
}
if (!providerConfig.orgEnabled) {
return;
}
const taskRunner =
options.schedule ??
options.scheduler!.createScheduledTaskRunner(providerConfig.schedule!);