spike-2 / Spike-2

Server specific Discord bot
https://spike-2.github.io
1 stars 0 forks source link

ITS Service Notes should have a timeout #14

Closed brandoningli closed 3 years ago

brandoningli commented 3 years ago

Describe the bug

Getting ITS Service Notes can hang when a network connection is lost, preventing any future requests for them.

To Reproduce

  1. Cut network connection
  2. Wait for ITS Service Notes to be fetched

Expected behavior

The request times out after a certain period

Screenshots

Runtime Info

Additional context

brandoningli commented 3 years ago

This SO article explains how to use Promises to implement a timeout. https://stackoverflow.com/a/60551865

brandoningli commented 3 years ago

This should also be wrapped in a try/catch.