title: Disconnecting from mysql database in rufus scheduler doesnt work (dashing.io)
body: <p>I am using dashing.io and want to grab some data from a mysql database using rufus scheduler to push them.</p>
  
  <p>I have this code for testing the connection closing in one .rb job file:</p>
  
  <pre><code>require 'rubygems'
  require 'mysql2'
  SCHEDULER.every '12h', :first_in =&gt; 0 do |job|
    begin
      db = Mysql2::Client.new(:host =&gt; "localhost", :username =&gt; "root", :password =&gt; "rainer-zufall", :port =&gt; 2971, :database =&gt; "test" )
      open_connections = db.query("show status like 'Connections';")
      open_connections.each do |row|
        puts "connections: #{row}"
      end
    rescue
  
    ensure
      db.close
    end
  end
  </code></pre>
  
  <p>The database connection do not close. The connection counter still increases and soon there will be an error stating max_connections reached from the mysql-server.</p>
  
  <p>Can anybody help?</p>