hashview / hashview-old

A web front-end for password cracking and analytics
http://www.hashview.io
GNU General Public License v3.0
621 stars 134 forks source link

Bug/db connection refactor: Fix database connection syntax errors. #435

Closed Script-Nomad closed 5 years ago

Script-Nomad commented 5 years ago

The database connection scheme is extremely cumbersome and error prone within the Rakefile where it could be much more simplified with a single function that returns the database connection as a handler. This ensures the call to Mysql2::Client.new() only needs to happen once throughout the execution of the Rakefile tasks and is far more reliable, and can be changed in the event that the Mysql2 gem changes in the future. If Mysql2's syntax has changed significantly between versions, then a second function should be used as a fallback to a previous version in order to prevent simple connection failures from causing massive cryptic stacktraces.

This PR addresses Issue #435 which allows the rake update to take place properly.

Cheers 🥂

i128 commented 5 years ago

Looks good!