Skip to content

Commit 80521d8

Browse files
committed
fix TMPDIR_PATH not exits at first run
1 parent 8c22aff commit 80521d8

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

tspider.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,9 @@ def cmdparse():
5757
if args.keepon:
5858
redis_handle.restore_startup_params(args)
5959
logger.info(args)
60-
61-
for f in os.listdir(TMPDIR_PATH):
62-
os.remove(os.path.join(TMPDIR_PATH, f))
60+
if os.path.exists(TMPDIR_PATH):
61+
for f in os.listdir(TMPDIR_PATH):
62+
os.remove(os.path.join(TMPDIR_PATH, f))
6363
tspider_context = {}
6464
tspider_context['live_spider_counts'] = Value('i', 0)
6565
tspider_context['task_done'] = Event()

0 commit comments

Comments
 (0)