Skip to content

Commit

Permalink
improve win autostart
Browse files Browse the repository at this point in the history
  • Loading branch information
pirog committed Nov 27, 2024
1 parent 92e5dd6 commit bfddc42
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion hooks/lando-setup-build-engine-win32.js
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ module.exports = async (lando, options) => {

// if we get here let's make sure the engine is on
try {
await lando.engine.daemon.up({max: 1, backoff: 1000});
await lando.engine.daemon.up({max: 5, backoff: 1000});
return true;
} catch (error) {
lando.log.debug('docker install task has not run %j', error);
Expand Down
2 changes: 1 addition & 1 deletion hooks/lando-setup-build-engine-wsl.js
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ module.exports = async (lando, options) => {

// if we get here let's make sure the engine is on
try {
await lando.engine.daemon.up({max: 1, backoff: 1000});
await lando.engine.daemon.up({max: 5, backoff: 1000});
return true;
} catch (error) {
lando.log.debug('docker install task has not run %j', error);
Expand Down
3 changes: 2 additions & 1 deletion lib/daemon.js
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,8 @@ module.exports = class LandoDaemon {
case 'win32':
case 'wsl':
const wscript = path.join(this.scriptsDir, 'docker-desktop-start.ps1');
await require('../utils/run-powershell')(wscript, undefined, {debug: this.debug});
await require('../utils/run-powershell-script')([wscript], undefined, {debug: this.debug});
await require('delay')(2000);
break;
}

Expand Down
4 changes: 2 additions & 2 deletions plugins/networking/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ module.exports = lando => {

// otherwise attempt to sus things out
try {
await lando.engine.daemon.up({max: 1, backoff: 1000});
await lando.engine.daemon.up({max: 5, backoff: 1000});
const landonet = lando.engine.getNetwork(lando.config.networkBridge);
await landonet.inspect();
return lando.versions.networking > 1;
Expand All @@ -90,7 +90,7 @@ module.exports = lando => {
const daemon = new LandoDaemon(lando.cache, lando.events, undefined, lando.log);

// we need docker up for this
await daemon.up({max: 2, backoff: 1000});
await daemon.up({max: 5, backoff: 1000});

// if we are v1 then disconnect and remove for upgrade
if (lando.versions.networking === 1) {
Expand Down
2 changes: 1 addition & 1 deletion utils/get-docker-x.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,6 @@ const getDockerBin = (bin, base, pathFallback = true) => {
};

module.exports = () => {
const base = (process.landoPlatform ?? process.platform === 'linux') ? '/usr/bin' : require('./get-docker-bin-path')();
const base = (process.landoPlatform === 'linux' || process.platform === 'linux') ? '/usr/bin' : require('./get-docker-bin-path')();
return getDockerBin('docker', base);
};

0 comments on commit bfddc42

Please sign in to comment.