Skip to content

Commit

Permalink
make shutdown URL not required
Browse files Browse the repository at this point in the history
  • Loading branch information
aaronkvanmeerten committed Apr 19, 2024
1 parent 43df41d commit f058b6b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions src/autoscale_poller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,9 @@ export default class AutoscalePoller {
*/
async reportShutdown(): Promise<void> {
try {
if (!this.shutdownUrl) {
throw('No shutdown URL configured');

Check failure on line 61 in src/autoscale_poller.ts

View workflow job for this annotation

GitHub Actions / Build

Expected an error object to be thrown
}
await this.asapRequest.postJson(this.shutdownUrl, this.instanceDetails);
} catch (err) {
logger.error('Error sending shutdown report', { err,
Expand Down
2 changes: 1 addition & 1 deletion src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const env = envalid.cleanEnv(process.env, {
ASAP_JWT_AUD: envalid.str({ default: 'jitsi-autoscaler' }),
ENABLE_REPORT_STATS: envalid.bool({ default: false }),
POLLING_URL: envalid.str(),
SHUTDOWN_URL: envalid.str(),
SHUTDOWN_URL: envalid.str({ default: '' }),
STATUS_URL: envalid.str(),
STATS_RETRIEVE_URL: envalid.str({ default: '' }),
STATS_REPORT_URL: envalid.str({ default: '' }),
Expand Down

0 comments on commit f058b6b

Please sign in to comment.