-
Notifications
You must be signed in to change notification settings - Fork 206
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1394 from akto-api-security/develop
Develop
- Loading branch information
Showing
4 changed files
with
124 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
apps/dashboard/src/main/java/com/akto/utils/jobs/JobUtils.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package com.akto.utils.jobs; | ||
|
||
import com.akto.util.DashboardMode; | ||
|
||
public class JobUtils { | ||
|
||
public static boolean getRunJobFunctions() { | ||
try { | ||
return Boolean.parseBoolean(System.getenv().getOrDefault("AKTO_RUN_JOB", "false")); | ||
} catch (Exception e) { | ||
return true; | ||
} | ||
} | ||
|
||
public static boolean getRunJobFunctionsAnyway() { | ||
try { | ||
return DashboardMode.isOnPremDeployment() || !DashboardMode.isSaasDeployment(); | ||
} catch (Exception e) { | ||
return true; | ||
} | ||
} | ||
} |