Fix an endless loop where documents gets added to queue, and deleted again.
Sets time for queue to 300 seconds.