Added sleep to prevent high speed query stream from causing a locked db