Merge pull request #14836 from overleaf/ab-split-test-cache-refactoring
[web] Fetch all active split test into cache at once GitOrigin-RevId: b477b88bf281349433af2cf692a0e9ea5b036588
This commit is contained in:
committed by
Copybot
parent
719da5fbd8
commit
b8a5eca1d0
@@ -57,6 +57,16 @@ async function getSplitTests({ name, phase, type, active, archived }) {
|
||||
}
|
||||
}
|
||||
|
||||
async function getRuntimeTests() {
|
||||
try {
|
||||
return await SplitTest.find({
|
||||
archived: { $ne: true },
|
||||
}).exec()
|
||||
} catch (error) {
|
||||
throw OError.tag(error, 'Failed to get active split tests list')
|
||||
}
|
||||
}
|
||||
|
||||
async function getSplitTest(query) {
|
||||
try {
|
||||
return await SplitTest.findOne(query)
|
||||
@@ -439,6 +449,7 @@ function _mergeFlags(incomingTests, baseTests) {
|
||||
module.exports = {
|
||||
getSplitTest,
|
||||
getSplitTests,
|
||||
getRuntimeTests,
|
||||
createSplitTest,
|
||||
updateSplitTestConfig,
|
||||
updateSplitTestInfo,
|
||||
|
||||
Reference in New Issue
Block a user