-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Minor optimizations to decrease the job latencies (#200)
- Change job polling frequency based on the activity level of the cluster - Change the results polling frequency to have a low base and a backoff
- Loading branch information
Showing
4 changed files
with
63 additions
and
34 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import Cache from "node-cache"; | ||
|
||
const cache = new Cache({ stdTTL: 60, maxKeys: 1000 }); | ||
|
||
export const setClusterActivityToHigh = (clusterId: string) => { | ||
cache.set(clusterId, true); | ||
}; | ||
|
||
export const isClusterActivityHigh = (clusterId: string) => { | ||
return cache.get(clusterId) === true; | ||
}; |
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