def run_spider():
    l.stop()
runner = CrawlerRunner(get_project_settings())
d = runner.crawl('spider_name')
d.addBoth(lambda _: l.start(timeout, False))
l = task.LoopingCall(run_spider)
l.start(timeout)
reactor.run()
How restart Scrapy spider