fix #894 console hang with large number of files
cleanup observe task codes