@@ -113,7 +113,7 @@ def schedule_task_with_lock(self, task):
113
113
pipe .lpush (task_queue , * urls )
114
114
pipe .hset (TIMER_RECORDER , task_name , now )
115
115
pipe .execute ()
116
- scheduler_logger ('crawler task {} has been stored into redis successfully' .format (task_name ))
116
+ scheduler_logger . info ('crawler task {} has been stored into redis successfully' .format (task_name ))
117
117
return True
118
118
else :
119
119
return None
@@ -146,13 +146,13 @@ def schedule_task_with_lock(self, task):
146
146
r , proxies = pipe .execute ()
147
147
if not r or (now - int (r .decode ('utf-8' ))) >= internal * 60 :
148
148
if not proxies :
149
- scheduler_logger ('fetched no proxies from task {}' .format (task_name ))
149
+ scheduler_logger . warning ('fetched no proxies from task {}' .format (task_name ))
150
150
return None
151
151
152
152
pipe .sadd (task_queue , * proxies )
153
153
pipe .hset (TIMER_RECORDER , task_name , now )
154
154
pipe .execute ()
155
- scheduler_logger ('validator task {} has been stored into redis successfully' .format (task_name ))
155
+ scheduler_logger . info ('validator task {} has been stored into redis successfully' .format (task_name ))
156
156
return True
157
157
else :
158
158
return None
@@ -165,6 +165,7 @@ def schedule_task_with_lock(self, task):
165
165
@click .argument ('task_queues' , nargs = - 1 )
166
166
def scheduler_start (usage , task_queues ):
167
167
"""Start specified scheduler."""
168
+ scheduler_logger .info ('{} scheduler is starting...' .format (usage ))
168
169
default_tasks = CRWALER_TASKS if usage == 'crawler' else VALIDATOR_TASKS
169
170
default_allow_tasks = DEFAULT_CRAWLER_TASKS if usage == 'crawler' else DEFAULT_VALIDATORS_TASKS
170
171
maps = CRAWLER_TASK_MAPS if usage == 'crawler' else TEMP_TASK_MAPS
@@ -177,7 +178,7 @@ def scheduler_start(usage, task_queues):
177
178
for task_queue in task_queues :
178
179
allow_task_queue = maps .get (task_queue )
179
180
if not allow_task_queue :
180
- scheduler_logger ('scheduler task {} is invalid task, the allowed tasks are {}' .format (
181
+ scheduler_logger . warning ('scheduler task {} is an invalid task, the allowed tasks are {}' .format (
181
182
task_queue , list (maps .keys ())))
182
183
continue
183
184
scheduler .task_queues .append (allow_task_queue )
@@ -207,7 +208,7 @@ def crawler_start(usage, tasks):
207
208
spiders .append (case .spider )
208
209
break
209
210
else :
210
- crawler_logger .warning ('spider task {} is invalid task, the allowed tasks are {}' .format (
211
+ crawler_logger .warning ('spider task {} is an invalid task, the allowed tasks are {}' .format (
211
212
task , list (maps .keys ())))
212
213
if not spiders :
213
214
crawler_logger .warning ('no spider starts up, please check your task input' )
0 commit comments