Skip to content

Commit c9e3b0a

Browse files
committed
Fix bug blowing away cached runs on initial load
1 parent a194983 commit c9e3b0a

File tree

2 files changed

+4
-7
lines changed

2 files changed

+4
-7
lines changed

github.js

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,6 @@ GitHub.refreshRuns = async function refreshRuns() {
156156
debug('Starting refreshing runs');
157157
try {
158158
_refreshingRuns = true;
159-
const rows = [];
160159
const repos = await GitHub.listRepos();
161160
for (const repo of repos) {
162161
debug(`repo: ${repo.name}`);
@@ -170,8 +169,6 @@ GitHub.refreshRuns = async function refreshRuns() {
170169
}
171170
}
172171
}
173-
174-
_runs = rows;
175172
} catch (e) {
176173
console.error('Error getting initial data', e);
177174
}
@@ -181,7 +178,7 @@ GitHub.refreshRuns = async function refreshRuns() {
181178
}
182179
};
183180

184-
GitHub.getInitialData = async function getInitialData() {
181+
GitHub.getInitialData = function getInitialData() {
185182
debug(`getInitialData _runs.length: ${_runs.length}`);
186183
if (_runs.length === 0 && !_refreshingRuns) {
187184
debug('getInitialData calling refreshRuns');

routes.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,12 @@ router.get('/owner', function (req, res, next) {
99
res.send(owner);
1010
});
1111

12-
router.get('/initialData', async function (req, res, next) {
13-
const initialData = await gitHub.getInitialData();
12+
router.get('/initialData', function (req, res, next) {
13+
const initialData = gitHub.getInitialData();
1414
res.send(initialData);
1515
});
1616

17-
router.get('/runs/:owner/:repo/:workflow_id', async function (req, res, next) {
17+
router.get('/runs/:owner/:repo/:workflow_id', function (req, res, next) {
1818
gitHub.refreshWorkflow(req.params.owner, req.params.repo, parseInt(req.params.workflow_id));
1919
res.send();
2020
});

0 commit comments

Comments
 (0)