diff --git a/.github/workflows/static-code-analysis.yml b/.github/workflows/static-code-analysis.yml index b4b9c0bf..f0b90613 100644 --- a/.github/workflows/static-code-analysis.yml +++ b/.github/workflows/static-code-analysis.yml @@ -33,14 +33,10 @@ jobs: contents: read security-events: write - strategy: - fail-fast: true - steps: - name: Checkout repository uses: actions/checkout@v3 - # Initializes the CodeQL tools for scanning. - name: Initialize CodeQL uses: github/codeql-action/init@v2 with: diff --git a/container/shim/src/modules/registration.js b/container/shim/src/modules/registration.js index 765e331d..f9269eb2 100644 --- a/container/shim/src/modules/registration.js +++ b/container/shim/src/modules/registration.js @@ -45,11 +45,12 @@ export async function register(initial = false) { verifyHWRequirements(requirements, stats); + let preregisterResponse; if (initial) { - await sendPreRegisterRequest(postOptions({ nodeId: NODE_ID })); + preregisterResponse = await sendPreRegisterRequest(postOptions({ nodeId: NODE_ID })); } - if (VERSION !== DEV_VERSION && initial) { + if (VERSION !== DEV_VERSION && initial && preregisterResponse?.speedtestRequired !== false) { let speedtest; try { speedtest = await getSpeedtest(); @@ -257,6 +258,8 @@ async function sendPreRegisterRequest(postOptions) { } debug("Successful pre-registration"); + + return await res.json(); } catch (err) { debug("Failed pre-registration: %s", err.message); // we don't try again if we fail the pre-registration