3 ms·
The QOTD seems to just hang sometimes. Anyone have any guesses as to why?
by dilap 11y ago
The QOTD seems to just hang sometimes. Anyone have any guesses as to why?
- molecule 11y agoFor zero-based arrays, which Ruby has, it looks like the random_index passed to the CSV array can exceed the array's bounds due to the '+1': random_index = rand(quotes_array.length + 1) @quote_body = quotes_array[random_index]["Quote"] @quote_author = quotes_array[random_index]["Author"] https://github.com/theaisforannie/qotd/blob/master/qotd.rb#L34-L36 https://github.com/theaisforannie/qotd/blob/master/qotd.rb#L...
- dilap 11y agoAh, and then it just silently throws an exc and never closes the connection. Nice. Gracias Señor@!