commented out sleep which I use for testing of active jobs/job refresh page, and re-title the job list html
This commit is contained in:
4
job.py
4
job.py
@@ -20,7 +20,7 @@ class Joblog(db.Model):
|
|||||||
return "<id: {}, job_id: {}, log: {}".format(self.id, self.job_id, self.log )
|
return "<id: {}, job_id: {}, log: {}".format(self.id, self.job_id, self.log )
|
||||||
|
|
||||||
################################################################################
|
################################################################################
|
||||||
# Class describing Action in the database, and via sqlalchemy, connected to the DB as well
|
# Class describing Job in the database, and via sqlalchemy, connected to the DB as well
|
||||||
################################################################################
|
################################################################################
|
||||||
class Job(db.Model):
|
class Job(db.Model):
|
||||||
id = db.Column(db.Integer, db.Sequence('joblog_id_seq'), primary_key=True )
|
id = db.Column(db.Integer, db.Sequence('joblog_id_seq'), primary_key=True )
|
||||||
@@ -74,7 +74,7 @@ def NewJob(name, num_passes="1", num_files="0", wait_for=None ):
|
|||||||
################################################################################
|
################################################################################
|
||||||
@app.route("/jobs", methods=["GET"])
|
@app.route("/jobs", methods=["GET"])
|
||||||
def jobs():
|
def jobs():
|
||||||
page_title='Job actions'
|
page_title='Job list'
|
||||||
jobs = Job.query.all()
|
jobs = Job.query.all()
|
||||||
return render_template("jobs.html", jobs=jobs, page_title=page_title)
|
return render_template("jobs.html", jobs=jobs, page_title=page_title)
|
||||||
|
|
||||||
|
|||||||
@@ -171,7 +171,8 @@ class FileData():
|
|||||||
AddLogForJob(job, "Found new file: {}".format(fname) )
|
AddLogForJob(job, "Found new file: {}".format(fname) )
|
||||||
else:
|
else:
|
||||||
AddLogForJob(job, "DEBUG: {} - {} is OLDER than {}".format( file, stat.st_ctime, last_import_date ), file )
|
AddLogForJob(job, "DEBUG: {} - {} is OLDER than {}".format( file, stat.st_ctime, last_import_date ), file )
|
||||||
time.sleep(0.4)
|
# include this for making the job be a bit slower, and # allowing testing of active jobs/job refresh page, etc.
|
||||||
|
# time.sleep(0.4)
|
||||||
settings.last_import_date = time.time()
|
settings.last_import_date = time.time()
|
||||||
session.commit()
|
session.commit()
|
||||||
return self
|
return self
|
||||||
|
|||||||
Reference in New Issue
Block a user