Skip to content

Commit 11aeead

Browse files
Increases cache max age
1 parent a7284d8 commit 11aeead

File tree

3 files changed

+42
-30
lines changed

3 files changed

+42
-30
lines changed
Lines changed: 36 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,40 @@
11
import { AdapterConfig } from '@chainlink/external-adapter-framework/config'
22

3-
export const config = new AdapterConfig({
4-
API_KEY: {
5-
description: 'An API key for Data Provider',
6-
type: 'string',
7-
required: true,
8-
sensitive: true,
3+
export const config = new AdapterConfig(
4+
{
5+
API_KEY: {
6+
description: 'An API key for Data Provider',
7+
type: 'string',
8+
required: true,
9+
sensitive: true,
10+
},
11+
SECRET_KEY: {
12+
description: 'A key for Data Provider used in hashing the API key',
13+
type: 'string',
14+
required: true,
15+
sensitive: true,
16+
},
17+
API_ENDPOINT: {
18+
description: 'An API endpoint for Data Provider',
19+
type: 'string',
20+
default: 'https://api.navfundservices.com',
21+
},
22+
MAX_RETRIES: {
23+
description: 'Maximum attempts of sending a request',
24+
type: 'number',
25+
default: 3,
26+
},
27+
BACKGROUND_EXECUTE_MS: {
28+
description:
29+
'The amount of time the background execute should sleep before performing the next request',
30+
type: 'number',
31+
default: 120_000, // one call per two minute
32+
},
933
},
10-
SECRET_KEY: {
11-
description: 'A key for Data Provider used in hashing the API key',
12-
type: 'string',
13-
required: true,
14-
sensitive: true,
34+
{
35+
envDefaultOverrides: {
36+
CACHE_MAX_AGE: 900_000, // 15 minute cache
37+
RETRY: 0, // Disables retry on Framework
38+
},
1539
},
16-
API_ENDPOINT: {
17-
description: 'An API endpoint for Data Provider',
18-
type: 'string',
19-
default: 'https://api.navfundservices.com',
20-
},
21-
MAX_RETRIES: {
22-
description: 'Maximum attempts of sending a request',
23-
type: 'number',
24-
default: 3,
25-
},
26-
BACKGROUND_EXECUTE_MS: {
27-
description:
28-
'The amount of time the background execute should sleep before performing the next request',
29-
type: 'number',
30-
default: 120_000, // one call per two minute
31-
},
32-
})
40+
)

packages/sources/nav-libre/test/unit/date-utils.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ describe('date-utils', () => {
3131
})
3232
})
3333

34-
describe('clampToBusinessWindow', () => {
34+
describe('clampStartByBusinessDays', () => {
3535
const to = parse('07-15-2025', DATE_FORMAT, new Date())
3636

3737
it('returns the original from date when within the limit', () => {

packages/sources/nav-libre/test/unit/fund.test.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,11 @@ describe('getFund', () => {
1717
let getRequestHeadersStub: jest.SpyInstance
1818
beforeEach(() => {
1919
jest.clearAllMocks()
20-
getRequestHeadersStub = jest.spyOn(authModule, 'getRequestHeaders').mockReturnValue({})
20+
getRequestHeadersStub = jest.spyOn(authModule, 'getRequestHeaders').mockReturnValue({
21+
'x-date': 'dummy',
22+
'x-content-sha256': 'dummy',
23+
'x-hmac256-signature': 'dummy',
24+
})
2125
})
2226

2327
afterEach(() => {

0 commit comments

Comments
 (0)