From 516fa18fd5759ce656fd0e24927ca473b7d812a8 Mon Sep 17 00:00:00 2001 From: lanms <1367000465@qq.com> Date: Mon, 19 Nov 2018 14:53:23 +0800 Subject: [PATCH] fix BUG:when you create a new project,current projet is new one;job_dashboard.html has a wrong; make every time deploy spider,we know spider of project,dont waite for schedule --- SpiderKeeper/app/spider/controller.py | 3 +++ SpiderKeeper/app/templates/job_dashboard.html | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/SpiderKeeper/app/spider/controller.py b/SpiderKeeper/app/spider/controller.py index 296126b3..9e4e7053 100644 --- a/SpiderKeeper/app/spider/controller.py +++ b/SpiderKeeper/app/spider/controller.py @@ -512,6 +512,7 @@ def project_create(): project.project_name = project_name db.session.add(project) db.session.commit() + session['project_id'] = project.id return redirect("/project/%s/spider/deploy" % project.id, code=302) @@ -649,6 +650,8 @@ def spider_egg_upload(project_id): file.save(dst) agent.deploy(project, dst) flash('deploy success!') + from SpiderKeeper.app.schedulers.common import sync_spiders + sync_spiders() return redirect(request.referrer) diff --git a/SpiderKeeper/app/templates/job_dashboard.html b/SpiderKeeper/app/templates/job_dashboard.html index 494b93d7..88b46110 100644 --- a/SpiderKeeper/app/templates/job_dashboard.html +++ b/SpiderKeeper/app/templates/job_dashboard.html @@ -95,7 +95,7 @@

Running Jobs

{% if job.job_instance %} {{ job.job_execution_id }} - {{ job.job_instance_id }} + {{ job.job_instance_id }} {{ job.job_instance.spider_name }} {{ job.job_instance.spider_arguments }}