Skip to content

Commit

Permalink
chore(env): increase default arns error rate and timeout threshold
Browse files Browse the repository at this point in the history
This prevents premature triggering of circuit breaker
  • Loading branch information
dtfiedler committed Sep 23, 2024
1 parent 60d421b commit f079241
Showing 1 changed file with 13 additions and 14 deletions.
27 changes: 13 additions & 14 deletions src/config.ts
Original file line number Diff line number Diff line change
@@ -1,19 +1,18 @@
/**
* AR.IO Gateway
* Copyright (C) 2022-2023 Permanent Data Solutions, Inc. All Rights Reserved.
* Copyright (C) 2022-2024 Permanent Data Solutions, Inc.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
* http://www.apache.org/licenses/LICENSE-2.0
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import dotenv from 'dotenv';

Check failure on line 17 in src/config.ts

View workflow job for this annotation

GitHub Actions / test (ubuntu-latest)

incorrect header
import { canonicalize } from 'json-canonicalize';
Expand Down Expand Up @@ -276,19 +275,19 @@ export const ARNS_RESOLVER_PRIORITY_ORDER = env

export const ARNS_ON_DEMAND_CIRCUIT_BREAKER_TIMEOUT_MS = +env.varOrDefault(
'ARNS_ON_DEMAND_CIRCUIT_BREAKER_TIMEOUT_MS',
`${5 * 1000}`, // 5 seconds
`${10 * 1000}`, // 10 seconds
);

export const ARNS_ON_DEMAND_CIRCUIT_BREAKER_ERROR_THRESHOLD_PERCENTAGE =
+env.varOrDefault(
'ARNS_ON_DEMAND_CIRCUIT_BREAKER_ERROR_THRESHOLD_PERCENTAGE',
'50',
'75', // 75% error rate
);

export const ARNS_ON_DEMAND_CIRCUIT_BREAKER_ROLLING_COUNT_TIMEOUT_MS =
+env.varOrDefault(
'ARNS_ON_DEMAND_CIRCUIT_BREAKER_ROLLING_COUNT_TIMEOUT_MS',
`${60 * 1000}`, // 1 minute
`${3 * 60 * 1000}`, // 3 minutes
);

export const ARNS_ON_DEMAND_CIRCUIT_BREAKER_RESET_TIMEOUT_MS =
Expand Down

0 comments on commit f079241

Please sign in to comment.