mirror of https://github.com/scrapy/scrapy.git
using time.time() instead of datetime.utcnow() in engine.start_time atttribute
This commit is contained in:
parent
7e07f76edd
commit
bc463bc9e8
|
|
@ -4,7 +4,7 @@ This is the Scrapy engine which controls the Scheduler, Downloader and Spiders.
|
|||
For more information see docs/topics/architecture.rst
|
||||
|
||||
"""
|
||||
from datetime import datetime
|
||||
from time import time
|
||||
|
||||
from twisted.internet import reactor, task, defer
|
||||
from twisted.python.failure import Failure
|
||||
|
|
@ -49,7 +49,7 @@ class ExecutionEngine(object):
|
|||
"""Start the execution engine"""
|
||||
if self.running:
|
||||
return
|
||||
self.start_time = datetime.utcnow()
|
||||
self.start_time = time()
|
||||
send_catch_log(signal=signals.engine_started, sender=self.__class__)
|
||||
self._mainloop_task.start(5.0, now=True)
|
||||
reactor.callWhenRunning(self._mainloop)
|
||||
|
|
|
|||
|
|
@ -1,5 +1,7 @@
|
|||
"""Some debugging functions for working with the Scrapy engine"""
|
||||
|
||||
from time import time
|
||||
|
||||
from scrapy.core.engine import scrapyengine
|
||||
|
||||
def get_engine_status(engine=None):
|
||||
|
|
@ -8,7 +10,7 @@ def get_engine_status(engine=None):
|
|||
engine = scrapyengine
|
||||
|
||||
global_tests = [
|
||||
"datetime.utcnow()-engine.start_time",
|
||||
"time()-engine.start_time",
|
||||
"engine.is_idle()",
|
||||
"engine.scheduler.is_idle()",
|
||||
"len(engine.scheduler.pending_requests)",
|
||||
|
|
|
|||
Loading…
Reference in New Issue