Skip to content

Commit

Permalink
Merge branch 'v2.0' of github.com:unipept/unipept-desktop into v2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
pverscha committed Feb 10, 2023
2 parents 820970e + 65d6b18 commit 863c885
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 30 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
"better-sqlite3": "^8.0.1",
"check-disk-space": "^3.3.1",
"chokidar": "^3.5.3",
"compare-versions": "^6.0.0-rc.1",
"core-js": "^3.25.0",
"dockerode": "^3.3.4",
"electron": "^21.3.3",
Expand Down
25 changes: 3 additions & 22 deletions src/logic/Utils.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import { compareVersions } from "compare-versions";

export default class Utils {
static isWindows(): boolean {
return process.platform === "win32";
Expand All @@ -19,28 +21,7 @@ export default class Utils {
* @return True if firstVersion is larger than secondVersion
*/
static isVersionLargerThan(firstVersion: string, secondVersion: string): boolean {
const firstSplitted = firstVersion.split(".").map(x => parseInt(x));
const secondSplitted = secondVersion.split(".").map(x => parseInt(x));

if (firstSplitted.length < secondSplitted.length) {
for (let i = 0; i < secondSplitted.length - firstSplitted.length; i++) {
firstSplitted.push(0);
}
} else if (secondSplitted.length < firstSplitted.length) {
for (let i = 0; i < firstSplitted.length - secondSplitted.length; i++) {
secondSplitted.push(0);
}
}

for (let part = 0; part < firstSplitted.length; part++) {
if (firstSplitted[part] > secondSplitted[part]) {
return true;
} else if (firstSplitted[part] < secondSplitted[part]) {
return false;
}
}

return false;
return compareVersions(firstVersion, secondVersion) === 1;
}

static compareAssays<T>(a: T[], b: T[]): boolean {
Expand Down
5 changes: 4 additions & 1 deletion src/logic/application/BootstrapApplication.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import ConfigurationManager from "@/logic/configuration/ConfigurationManager";
import Configuration from "@/logic/configuration/Configuration";
import { NetworkConfiguration, QueueManager } from "unipept-web-components";
import { NetworkConfiguration, Pept2DataCommunicator, QueueManager } from "unipept-web-components";
import DockerCommunicator from "@/logic/communication/docker/DockerCommunicator";
import { Store } from "vuex";
import ApplicationMigrator from "@/logic/application/ApplicationMigrator";
Expand All @@ -20,6 +20,9 @@ export default class BootstrapApplication {
* Start and load the different components required for the application to function properly.
*/
public async loadApplicationComponents(): Promise<void> {
// Hack to lower the amount of peptides sent at the same time to the server
Pept2DataCommunicator.MISSED_CLEAVAGE_BATCH = 5;

await this.runApplicationMigrations();
const config = await this.initializeConfiguration();
this.initializeApi(config);
Expand Down
16 changes: 9 additions & 7 deletions src/logic/communication/analysis/CachedOnlineAnalysisSource.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,16 @@ export default class CachedOnlineAnalysisSource implements AnalysisSource {
}

public getCommunicationSource() {
const pept2DataCommunicator = new CachedPept2DataCommunicator(
this.assay,
new Pept2DataCommunicator(this.endpoint),
this.dbManager,
this.projectLocation,
this.store
);

return new ConfigureableCommunicationSource(
new CachedPept2DataCommunicator(
this.assay,
new Pept2DataCommunicator(this.endpoint),
this.dbManager,
this.projectLocation,
this.store
),
pept2DataCommunicator,
new CachedGoResponseCommunicator(),
new CachedEcResponseCommunicator(),
new CachedInterproResponseCommunicator(),
Expand Down
5 changes: 5 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3215,6 +3215,11 @@ compare-version@^0.1.2:
resolved "https://registry.yarnpkg.com/compare-version/-/compare-version-0.1.2.tgz#0162ec2d9351f5ddd59a9202cba935366a725080"
integrity sha512-pJDh5/4wrEnXX/VWRZvruAGHkzKdr46z11OlTPN+VrATlWWhSKewNCJ1futCO5C7eJB3nPMFZA1LeYtcFboZ2A==

compare-versions@^6.0.0-rc.1:
version "6.0.0-rc.1"
resolved "https://registry.yarnpkg.com/compare-versions/-/compare-versions-6.0.0-rc.1.tgz#93e6beb8767c2375333ee168fa64c28b75ace2c6"
integrity sha512-cFhkjbGY1jLFWIV7KegECbfuyYPxSGvgGkdkfM+ibboQDoPwg2FRHm5BSNTOApiauRBzJIQH7qvOJs2sW5ueKQ==

compressible@~2.0.16:
version "2.0.18"
resolved "https://registry.yarnpkg.com/compressible/-/compressible-2.0.18.tgz#af53cca6b070d4c3c0750fbd77286a6d7cc46fba"
Expand Down

0 comments on commit 863c885

Please sign in to comment.