Skip to content

Commit

Permalink
fix: reconciler (#1360)
Browse files Browse the repository at this point in the history
* fix: reconciler

* fix: search limit

* fix: revert swagger.json
  • Loading branch information
nassiharel authored Aug 9, 2021
1 parent 1a2226a commit 20bf46e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions core/algorithm-operator/lib/reconcile/algorithm-queue.js
Original file line number Diff line number Diff line change
Expand Up @@ -107,9 +107,10 @@ const _addDeployments = async ({ limit, availableQueues, algorithms, versions, r
};

const isRequired = ({ alg, algorithmsToQueue, waitingCount, algorithmQueues, maxIdleTime }) => {
const hasRequirement = !algorithmsToQueue[alg.name] && waitingCount[alg.name] > 0;
const isMissing = !algorithmsToQueue[alg.name];
const isQueued = waitingCount[alg.name] > 0;
const isActive = Date.now() - algorithmQueues[alg.name] < maxIdleTime;
return hasRequirement || isActive;
return isMissing && (isQueued || isActive);
};

const reconcile = async ({ deployments, algorithms, discovery, versions, registry, clusterOptions, resources, options, devMode } = {}) => {
Expand Down
2 changes: 1 addition & 1 deletion core/api-server/lib/validation/executions.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class ApiValidator {
}

validateSearch(request) {
this._validator.validate(this._validator.definitions.searchJobs, request, false);
this._validator.validate(this._validator.definitions.searchJobs, request, true);
}

validateExecAlgorithmRequest(request) {
Expand Down

0 comments on commit 20bf46e

Please sign in to comment.