Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix/allow stackerdb chunks #2113

Merged
merged 3 commits into from
Oct 14, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions src/event-stream/event-server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1053,6 +1053,36 @@ export async function startEventServer(opts: {
}
});

app.post('/stackerdb_chunks', async (req, res) => {
try {
await handleRawEventRequest(req);
if (isProdEnv) {
logger.warn(
'Received stackerdb_chunks message -- event not required for API operations and can cause db bloat and performance degradation in production'
);
}
await res.status(200).send({ result: 'ok' });
} catch (error) {
logger.error(error, 'error processing core-node /stackerdb_chunks');
await res.status(500).send({ error: error });
}
});

app.post('/proposal_response', async (req, res) => {
try {
await handleRawEventRequest(req);
if (isProdEnv) {
logger.warn(
'Received proposal_response message -- event not required for API operations and can cause db bloat and performance degradation in production'
);
}
await res.status(200).send({ result: 'ok' });
} catch (error) {
logger.error(error, 'error processing core-node /proposal_response');
await res.status(500).send({ error: error });
}
});

app.post('*', async (req, res) => {
await res.status(404).send({ error: `no route handler for ${req.url}` });
logger.error(`Unexpected event on path ${req.url}`);
Expand Down
Loading