Skip to content

Commit

Permalink
Skip the github runner environment when judging isIpv6
Browse files Browse the repository at this point in the history
  • Loading branch information
Leslie-Wong-H committed Sep 14, 2024
1 parent 0bbc091 commit e12fca2
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions src/search.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import https from "node:https";
import cv from "@soruly/opencv4nodejs-prebuilt";
import { performance } from "perf_hooks";
import { publicIpv6 } from "public-ip";
const runnerOs = process.env.GITHUB_RUNNER_OS;
// import getSolrCoreList from "./lib/get-solr-core-list.js";

// const { TRACE_MEDIA_URL, TRACE_MEDIA_SALT, TRACE_ACCURACY = 1 } = process.env;
Expand Down Expand Up @@ -55,11 +56,14 @@ const search = async (image) => {
};

let isIpv6 = false;
try {
isIpv6 = Boolean(await publicIpv6());
} catch (error) {
console.log(error);
isIpv6 = false;
// skip the github runner environemnt
if (!runnerOs) {
try {
isIpv6 = Boolean(await publicIpv6());
} catch (error) {
console.log(error);
isIpv6 = false;
}
}

const logAndDequeue = async (knex, redis, uid, priority, status, searchTime, accuracy) => {
Expand Down

0 comments on commit e12fca2

Please sign in to comment.