Added a long running query check

This could be implemented better so make it easier to specify the query time, either via a config file
and/or via the command-line. As it stands it is a variable the need to be edited in the script. Not ideal.
But it does at least function.