APMDB Pruning task stops working if any of the sql queries as part of this process fail