treewide: make less webhook-centric
Signed-off-by: NotAShelf <raf@notashelf.dev> Change-Id: Ifab58fcb523549ca9cb83dc8467be51e6a6a6964
This commit is contained in:
parent
d8c09eeefa
commit
374408834b
9 changed files with 479 additions and 39 deletions
10
src/index.ts
10
src/index.ts
|
|
@ -10,6 +10,7 @@ import {
|
|||
} from './github.js';
|
||||
import { createApp } from './server.js';
|
||||
import { createEngine } from './engine/index.js';
|
||||
import { startPolling } from './polling.js';
|
||||
import type { WebhookEvent } from './types.js';
|
||||
|
||||
async function analyzeOne(target: string) {
|
||||
|
|
@ -95,7 +96,9 @@ function serve() {
|
|||
);
|
||||
}
|
||||
if (!process.env.WEBHOOK_SECRET) {
|
||||
logger.warn('No WEBHOOK_SECRET - webhook signature verification is disabled');
|
||||
logger.warn(
|
||||
'No WEBHOOK_SECRET - webhook signature verification is disabled (not needed for polling-only mode)'
|
||||
);
|
||||
}
|
||||
|
||||
const app = createApp(config);
|
||||
|
|
@ -105,7 +108,7 @@ function serve() {
|
|||
.filter(([, v]) => v.enabled)
|
||||
.map(([k]) => k);
|
||||
|
||||
const server = app.listen(port, () => {
|
||||
const server = app.listen(port, async () => {
|
||||
logger.info(`Troutbot listening on port ${port}`);
|
||||
logger.info(`Enabled backends: ${enabledBackends.join(', ')}`);
|
||||
|
||||
|
|
@ -138,6 +141,9 @@ function serve() {
|
|||
logger.info(`Comment updates: ${config.response.allowUpdates ? 'enabled' : 'disabled'}`);
|
||||
|
||||
logger.info(`Dashboard available at http://localhost:${port}/dashboard`);
|
||||
|
||||
// Start polling if enabled
|
||||
await startPolling(config);
|
||||
});
|
||||
|
||||
function shutdown(signal: string) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue