"use strict";
Object.defineProperty(exports, "__esModule", {
    value: true
});
Object.defineProperty(exports, "ClientDistDownloadTask", {
    enumerable: true,
    get: function() {
        return ClientDistDownloadTask;
    }
});
const _serverconstants = require("../server.constants");
class ClientDistDownloadTask {
    clientBundleService;
    githubService;
    logger;
    constructor({ clientBundleService, loggerFactory, githubService }){
        this.githubService = githubService;
        this.clientBundleService = clientBundleService;
        this.logger = loggerFactory(ClientDistDownloadTask.name);
    }
    async run() {
        const result = await this.clientBundleService.shouldUpdateWithReason(false, _serverconstants.AppConstants.defaultClientMinimum);
        if (!result.shouldUpdate) {
            this.logger.log(`Client bundle update skipped. Reason: ${result.reason}`);
            return;
        }
        this.logger.log(`Client bundle update required. Reason for updating: ${result.reason}`);
        await this.clientBundleService.downloadClientUpdate(_serverconstants.AppConstants.defaultClientMinimum);
    }
}

//# sourceMappingURL=client-bundle.task.js.map