SpikeHD / AmazonMonitor

Amazon price checker, item monitor and stock monitor, all shoved into a Discord bot
GNU General Public License v3.0
234 stars 39 forks source link

[BUG] Concurrency problem in search command. #72

Closed iagopm closed 3 years ago

iagopm commented 3 years ago

Steps to reproduce:

Problem in await for response on search.js produces crash.

The response of the find request takes too much time to retrieve the result and then produces a crash. Making variable item null-safe and then reattempt the request should solve the issue.

Environment: Windows 10 19XX and node 16.7.0

Example: 2021-08-31 11_30_08-Window

2021-08-31 11_42_23-Window

{
  "prefix":"!",
  "token":"",
  "minutes_per_check":4,
  "search_response_ms": 60000,
  "url_params":{},
  "guild_item_limit":30,
  "cache_limit": 30,
  "required_perms":["permission_1", "permission_2"],
  "tld":"es",
  "auto_cart_link":true,
  "debug_enabled":true
}
SpikeHD commented 3 years ago

Should be fixed in the most recent commit