feat(env): improve support for instances without internet connection (#3915)
This commit is contained in:
@@ -3,6 +3,7 @@ import { Octokit } from "octokit";
|
||||
import { compareSemVer, isValidSemVer } from "semver-parser";
|
||||
|
||||
import { fetchWithTimeout } from "@homarr/common";
|
||||
import { env } from "@homarr/common/env";
|
||||
import { logger } from "@homarr/log";
|
||||
import { createChannelWithLatestAndEvents } from "@homarr/redis";
|
||||
import { createCachedRequestHandler } from "@homarr/request-handler/lib/cached-request-handler";
|
||||
@@ -13,6 +14,11 @@ export const updateCheckerRequestHandler = createCachedRequestHandler({
|
||||
queryKey: "homarr-update-checker",
|
||||
cacheDuration: dayjs.duration(1, "hour"),
|
||||
async requestAsync(_) {
|
||||
if (env.NO_EXTERNAL_CONNECTION)
|
||||
return {
|
||||
availableUpdates: [],
|
||||
};
|
||||
|
||||
const octokit = new Octokit({
|
||||
request: {
|
||||
fetch: fetchWithTimeout,
|
||||
|
||||
Reference in New Issue
Block a user