Skip to content

Commit

Permalink
Merge branch 'main' into mboulais/O2B-892/modernize-runs-details
Browse files Browse the repository at this point in the history
  • Loading branch information
martinboulais authored Dec 12, 2024
2 parents d9a1405 + 6d2c9c9 commit 7b00e6e
Show file tree
Hide file tree
Showing 11 changed files with 153 additions and 174 deletions.
2 changes: 1 addition & 1 deletion lib/config/services.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ const {
} = process.env ?? {};

exports.services = {
enableHousekeeping: process.env?.ENABLE_HOUSEKEEPING ?? false,
enableHousekeeping: process.env?.ENABLE_HOUSEKEEPING?.toLowerCase() === 'true',
aliEcsGui: {
url: process.env?.ALI_ECS_GUI_URL || null,
token: process.env?.ALI_ECS_GUI_TOKEN || null,
Expand Down
25 changes: 5 additions & 20 deletions lib/database/repositories/QcFlagRepository.js
Original file line number Diff line number Diff line change
Expand Up @@ -203,32 +203,17 @@ class QcFlagRepository extends Repository {
GROUP_CONCAT(effectivePeriods.flagsList) AS flagsList,
IF(
(
COALESCE(run.time_trg_end, run.time_o2_end ) IS NULL
OR COALESCE(run.time_trg_start, run.time_o2_start) IS NULL
),
run.time_start IS NULL OR run.time_end IS NULL,
IF(
SUM(
COALESCE(effectivePeriods.\`to\` , 0)
+ COALESCE(effectivePeriods.\`from\`, 0)
) = 0,
effectivePeriods.\`from\` IS NULL AND effectivePeriods.\`to\` IS NULL,
1,
null
),
SUM(
COALESCE(
effectivePeriods.\`to\`,
UNIX_TIMESTAMP(run.time_trg_end),
UNIX_TIMESTAMP(run.time_o2_end)
)
- COALESCE(
effectivePeriods.\`from\`,
UNIX_TIMESTAMP(run.time_trg_start),
UNIX_TIMESTAMP(run.time_o2_start)
)
COALESCE(effectivePeriods.\`to\`, UNIX_TIMESTAMP(run.time_end))
- COALESCE(effectivePeriods.\`from\`, UNIX_TIMESTAMP(run.time_start))
) / (
UNIX_TIMESTAMP(COALESCE(run.time_trg_end, run.time_o2_end))
- UNIX_TIMESTAMP(COALESCE(run.time_trg_start, run.time_o2_start))
UNIX_TIMESTAMP(run.time_end) - UNIX_TIMESTAMP(run.time_start)
)
) AS effectiveRunCoverage
Expand Down
7 changes: 1 addition & 6 deletions lib/public/components/Pagination/amountSelector.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,7 @@ const perPageAmountInputComponent = (onCustomChoiceConfirm, paginationModel) =>
oninput: ({ target }) => {
paginationModel.customItemsPerPage = target.value;
},
onkeyup: ({ key }) => {
if (key === 'Enter') {
onCustomChoiceConfirm();
}
},
onblur: onCustomChoiceConfirm,
onchange: onCustomChoiceConfirm,
});

/**
Expand Down
2 changes: 1 addition & 1 deletion lib/public/views/Runs/ActiveColumns/runsActiveColumns.js
Original file line number Diff line number Diff line change
Expand Up @@ -502,6 +502,6 @@ export const runsActiveColumns = {
name: 'L3 / Dipole',
visible: false,
filter: ({ aliceL3AndDipoleCurrentFilter }) => selectionDropdown(aliceL3AndDipoleCurrentFilter, { selectorPrefix: 'l3-dipole-current' }),
profiles: ['runsPerLhcPeriod', 'runsPerDataPass', 'runsPerSimulationPass'],
profiles: ['runsPerLhcPeriod', 'runsPerDataPass', 'runsPerSimulationPass', profiles.none],
},
};
27 changes: 6 additions & 21 deletions lib/server/services/qualityControlFlag/QcFlagService.js
Original file line number Diff line number Diff line change
Expand Up @@ -264,35 +264,20 @@ class QcFlagService {
[
sequelize.literal(`
IF(
(
COALESCE(run.time_trg_end, run.time_o2_end ) IS NULL
OR COALESCE(run.time_trg_start, run.time_o2_start) IS NULL
),
run.time_start IS NULL OR run.time_end IS NULL,
IF(
SUM(
COALESCE(UNIX_TIMESTAMP(effectivePeriods.\`to\` ), 0)
+ COALESCE(UNIX_TIMESTAMP(effectivePeriods.\`from\`), 0)
) = 0,
effectivePeriods.\`from\` IS NULL AND effectivePeriods.\`to\` IS NULL,
1,
null
),
SUM(
UNIX_TIMESTAMP(COALESCE(
effectivePeriods.\`to\`,
run.time_trg_end,
run.time_o2_end
))
- UNIX_TIMESTAMP(COALESCE(
effectivePeriods.\`from\`,
run.time_trg_start,
run.time_o2_start
))
UNIX_TIMESTAMP(COALESCE(effectivePeriods.\`to\`, run.time_end))
- UNIX_TIMESTAMP(COALESCE(effectivePeriods.\`from\`, run.time_start))
) / (
UNIX_TIMESTAMP(COALESCE(run.time_trg_end, run.time_o2_end))
- UNIX_TIMESTAMP(COALESCE(run.time_trg_start, run.time_o2_start))
UNIX_TIMESTAMP(run.time_end) - UNIX_TIMESTAMP(run.time_start)
)
)
`),
`),
'effectiveRunCoverage',
],
[
Expand Down
6 changes: 3 additions & 3 deletions lib/server/services/run/setO2StopOfLostRuns.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ exports.setO2StopOfLostRuns = async (runNumbersOfRunningRuns, modificationTimePe
FROM runs
WHERE time_o2_end IS NULL
AND time_trg_end IS NULL
AND COALESCE(time_trg_start, time_o2_start) IS NOT NULL
AND COALESCE(time_trg_start, time_o2_start) >= '${timestampToMysql(modificationTimePeriod.from, true)}'
AND COALESCE(time_trg_start, time_o2_start) < '${timestampToMysql(modificationTimePeriod.to, true)}'
AND time_start IS NOT NULL
AND time_start >= '${timestampToMysql(modificationTimePeriod.from, true)}'
AND time_start < '${timestampToMysql(modificationTimePeriod.to, true)}'
`;
if (runNumbersOfRunningRuns.length > 0) {
fetchQuery += ` AND run_number NOT IN (${runNumbersOfRunningRuns.join(',')})`;
Expand Down
Loading

0 comments on commit 7b00e6e

Please sign in to comment.