Skip to content

Commit

Permalink
Move isIpv6 judgement ahead
Browse files Browse the repository at this point in the history
  • Loading branch information
Leslie-Wong-H committed Jun 17, 2024
1 parent 090bc18 commit 4dd3834
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/search.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,14 @@ const search = async (image) => {
return [response];
};

let isIpv6 = false;
try {
isIpv6 = Boolean(await publicIpv6());
} catch (error) {
console.log(error);
isIpv6 = false;
}

const logAndDequeue = async (knex, redis, uid, priority, status, searchTime, accuracy) => {
if (status === 200) {
const searchCountCache = await knex("search_count").where({ uid: `${uid}` });
Expand Down Expand Up @@ -166,14 +174,6 @@ export default async (req, res) => {
});
}

let isIpv6 = false;
try {
isIpv6 = Boolean(await publicIpv6());
} catch (error) {
console.log(error);
isIpv6 = false;
}

const response = await fetch(
[
// "api.telegram.org",
Expand Down

0 comments on commit 4dd3834

Please sign in to comment.