Skip to content

Commit c4b122b

Browse files
authored
Merge pull request #70 from permaweb/fix/workflow-deploy
fix: up heap size in deploy yaml
2 parents b0a4d1e + 7f3e8f7 commit c4b122b

File tree

2 files changed

+10
-6
lines changed

2 files changed

+10
-6
lines changed

.github/workflows/deploy.yaml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,13 @@ jobs:
1010
publish:
1111
if: github.ref == 'refs/heads/main'
1212
runs-on: ubuntu-latest
13+
env:
14+
NODE_OPTIONS: --max-old-space-size=8192
1315
steps:
1416
- uses: actions/checkout@v2
1517
- uses: actions/setup-node@v1
1618
with:
17-
node-version: 20.x
19+
node-version: 22.x
1820
- run: npm install
1921
- run: npm run deploy:main
2022
env:
@@ -23,11 +25,13 @@ jobs:
2325
publish-staging:
2426
if: github.ref == 'refs/heads/staging'
2527
runs-on: ubuntu-latest
28+
env:
29+
NODE_OPTIONS: --max-old-space-size=8192
2630
steps:
2731
- uses: actions/checkout@v2
2832
- uses: actions/setup-node@v1
2933
with:
30-
node-version: 20.x
34+
node-version: 22.x
3135
- run: npm install
3236
- run: npm run deploy:staging
3337
env:

src/providers/AOProvider.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { connect } from '@permaweb/aoconnect';
55
import { AO, AO_TOKEN_DENOMINATION, ENDPOINTS } from 'helpers/config';
66
import { AONetworkStatus, AOPhase, MetricDataPoint, TagType } from 'helpers/types';
77

8-
const CACHE_DURATION = 6 * 60 * 60 * 1000;
8+
const CACHE_DURATION = 0;
99

1010
export const cu: any = connect({
1111
MODE: 'legacy',
@@ -100,7 +100,7 @@ export function AOProvider(props: { children: React.ReactNode }) {
100100

101101
if (dataMainnet?.length > 0) {
102102
for (const elementMainnet of dataMainnet) {
103-
const dayLegacy = dataLegacy.find((elementLegacy: any) => elementLegacy.day === elementMainnet.day);
103+
const dayLegacy = dataLegacy?.find((elementLegacy: any) => elementLegacy.day === elementMainnet.day);
104104

105105
if (dayLegacy) {
106106
mergedData.push({
@@ -128,12 +128,12 @@ export function AOProvider(props: { children: React.ReactNode }) {
128128
localStorage.setItem(
129129
cacheKey,
130130
JSON.stringify({
131-
data: mergedData.reverse(),
131+
data: mergedData,
132132
timestamp: Date.now(),
133133
})
134134
);
135135

136-
setMetrics(mergedData.reverse());
136+
setMetrics(mergedData);
137137
} catch (e: any) {
138138
console.error(e);
139139
}

0 commit comments

Comments
 (0)