-
-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Prevent duplicate cache setting for masterNodeUrl
This change modifies the startup process to check if '_ssm_masterNodeUrl' is already set in the cache before attempting to set it again. This prevents redundant operations and ensures the value is only set if it does not already exist.
- Loading branch information
SquirrelDevelopper
committed
Nov 14, 2024
1 parent
f383e0e
commit 60f80d9
Showing
6 changed files
with
92 additions
and
1 deletion.
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
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 { SsmAnsible } from 'ssm-shared-lib'; | ||
import { setToCache } from '../../../data/cache'; | ||
import { SuccessResponse } from '../../../middlewares/api/ApiResponse'; | ||
|
||
export const postMasterNodeUrlValue = async (req, res) => { | ||
const { value } = req.body; | ||
await setToCache(SsmAnsible.DefaultSharedExtraVarsList.MASTER_NODE_URL, value); | ||
new SuccessResponse('Set master node url value', { | ||
value, | ||
}).send(res); | ||
}; |
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,4 @@ | ||
import { body } from 'express-validator'; | ||
import validator from '../../../middlewares/Validator'; | ||
|
||
export const postMasterNodeUrlValueValidator = [body('value').exists().isString(), validator]; |
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