diff --git a/cvat-core/src/api.ts b/cvat-core/src/api.ts index f4eb5d8b23fd..60de43fd4b18 100644 --- a/cvat-core/src/api.ts +++ b/cvat-core/src/api.ts @@ -320,6 +320,12 @@ function build(): CVATCore { set requestsStatusDelay(value) { config.requestsStatusDelay = value; }, + get jobMetaDataReloadPeriod() { + return config.jobMetaDataReloadPeriod; + }, + set jobMetaDataReloadPeriod(value) { + config.jobMetaDataReloadPeriod = value; + }, }, client: { version: `${pjson.version}`, diff --git a/cvat-core/src/config.ts b/cvat-core/src/config.ts index 99d76a723655..eefb535814bb 100644 --- a/cvat-core/src/config.ts +++ b/cvat-core/src/config.ts @@ -19,6 +19,8 @@ const config = { globalObjectsCounter: 0, requestsStatusDelay: null, + + jobMetaDataReloadPeriod: 1 * 60 * 60 * 1000, // 1 hour }; export default config; diff --git a/cvat-core/src/frames.ts b/cvat-core/src/frames.ts index e02b3e640a83..dfdd35684178 100644 --- a/cvat-core/src/frames.ts +++ b/cvat-core/src/frames.ts @@ -12,6 +12,7 @@ import serverProxy from './server-proxy'; import { SerializedFramesMetaData } from './server-response-types'; import { Exception, ArgumentError, DataError } from './exceptions'; import { FieldUpdateTrigger } from './common'; +import config from './config'; // frame storage by job id const frameDataCache: Record { throw new Error('Frame data cache is abscent'); } - const META_DATA_RELOAD_PERIOD = 1 * 60 * 60 * 1000; // 1 hour - const isOutdated = (Date.now() - cached.metaFetchedTimestamp) > META_DATA_RELOAD_PERIOD; + const isOutdated = (Date.now() - cached.metaFetchedTimestamp) > config.jobMetaDataReloadPeriod; if (isOutdated) { // get metadata again if outdated diff --git a/cvat-core/src/index.ts b/cvat-core/src/index.ts index 79ce8b305a9f..4eff35601f70 100644 --- a/cvat-core/src/index.ts +++ b/cvat-core/src/index.ts @@ -187,6 +187,7 @@ export default interface CVATCore { onOrganizationChange: (newOrgId: number | null) => void | null; globalObjectsCounter: typeof config.globalObjectsCounter; requestsStatusDelay: typeof config.requestsStatusDelay; + jobMetaDataReloadPeriod: typeof config.jobMetaDataReloadPeriod; }, client: { version: string; diff --git a/tests/cypress/support/commands.js b/tests/cypress/support/commands.js index f0f085260cbf..9941a9b0d5c3 100644 --- a/tests/cypress/support/commands.js +++ b/tests/cypress/support/commands.js @@ -908,6 +908,14 @@ Cypress.Commands.add('configureTaskQualityMode', (qualityConfigurationParams) => cy.contains(qualityConfigurationParams.validationMode).click(); }); } + if (qualityConfigurationParams.validationFramesPercent) { + cy.get('#validationFramesPercent').clear(); + cy.get('#validationFramesPercent').type(qualityConfigurationParams.validationFramesPercent); + } + if (qualityConfigurationParams.validationFramesPerJobPercent) { + cy.get('#validationFramesPerJobPercent').clear(); + cy.get('#validationFramesPerJobPercent').type(qualityConfigurationParams.validationFramesPerJobPercent); + } }); Cypress.Commands.add('removeAnnotations', () => {