-
-
Notifications
You must be signed in to change notification settings - Fork 83
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Once the keepforever checkbox is selected for a build, this build will not be removed even if we reach max # builds to keep. Ideally, this keepforever option should only be avaliable for admin. This should be enhanced once we have authentication added. Signed-off-by: lanxia <[email protected]>
- Loading branch information
Showing
5 changed files
with
67 additions
and
7 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
const { TestResultsDB, ObjectID } = require('../Database'); | ||
|
||
/* | ||
* updateKeepForever API updates keepForever based on _id | ||
*/ | ||
module.exports = async (req, res) => { | ||
const { _id, keepForever } = req.query; | ||
if (_id && keepForever) { | ||
const keepForeverVal = (keepForever === 'true'); | ||
const db = new TestResultsDB(); | ||
const criteria = { _id: new ObjectID(_id) }; | ||
await db.update(criteria, { $set: { keepForever: keepForeverVal } }, { upsert: false }); | ||
res.send({ error: false }); | ||
} else { | ||
res.json({ error: true }); | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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