Skip to content

Commit

Permalink
fix(datasource/npm): don’t reuse cache for host-disabled (#19840)
Browse files Browse the repository at this point in the history
  • Loading branch information
rarkins committed Jan 14, 2023
1 parent 2180f5b commit 05bb942
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/modules/datasource/npm/get.ts
Expand Up @@ -2,6 +2,7 @@ import url from 'url';
import is from '@sindresorhus/is';
import { DateTime } from 'luxon';
import { GlobalConfig } from '../../../config/global';
import { HOST_DISABLED } from '../../../constants/error-messages';
import { logger } from '../../../logger';
import { ExternalHostError } from '../../../types/errors/external-host-error';
import * as packageCache from '../../../util/cache/package';
Expand Down Expand Up @@ -196,6 +197,7 @@ export async function getDependency(
const ignoredStatusCodes = [401, 402, 403, 404];
const ignoredResponseCodes = ['ENOTFOUND'];
if (
err.message === HOST_DISABLED ||
ignoredStatusCodes.includes(err.statusCode) ||
ignoredResponseCodes.includes(err.code)
) {
Expand Down

0 comments on commit 05bb942

Please sign in to comment.