Skip to content

Commit

Permalink
Merge pull request #7 from pmandrik/master
Browse files Browse the repository at this point in the history
Testing PR to trigger GitHub Workflow
  • Loading branch information
pmandrik authored Apr 16, 2023
2 parents b58d1be + 2ee06dc commit 39f2a9a
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -136,3 +136,5 @@ Secrets and versions of DQM^2 need to match DQM^2 Mirror requirements, please ch





9 changes: 6 additions & 3 deletions dqmsquare_cfg.py
Original file line number Diff line number Diff line change
Expand Up @@ -405,6 +405,9 @@ def fill_graph(self, header, document):
global_start = extra.get("global_start", datetime.datetime(2012, 3, 3, 10, 10, 10) )
stream_data = str(extra.get("streams", ""))
hostname = header.get("hostname", "")

if not isinstance(global_start, datetime.datetime):
global_start = datetime.datetime.fromtimestamp( global_start )

values = [ run, rev, id, timestamp, global_start, stream_data, hostname ]
values_dic = {}
Expand All @@ -420,7 +423,7 @@ def fill_graph(self, header, document):
# cur.execute( sqlalchemy.insert( self.TB_NAME_GRAPHS ).values( values_dic )
session.execute( sqlalchemy.insert( self.db_meta.tables[ self.TB_NAME_GRAPHS ] ).values( values_dic ) )
session.commit()
except sqlite3.IntegrityError as e:
except Exception as e:
self.log.error("Error occurred: ", e)
session.rollback()
return 1
Expand Down Expand Up @@ -479,7 +482,7 @@ def fill(self, header, document):
session.execute("DELETE FROM " + self.TB_NAME + " WHERE id = '" + str(id) + "'" )
session.execute( sqlalchemy.insert( self.db_meta.tables[ self.TB_NAME ] ).values( values_dic ) )
session.commit()
except sqlite3.IntegrityError as e:
except Exception as e:
self.log.error("Error occurred: ", e)
session.rollback()
return 1
Expand Down Expand Up @@ -645,7 +648,7 @@ def update_min_max( self, new_min, new_max ):
session.execute("DELETE FROM " + self.TB_NAME_META + " WHERE name = 'min_max_runs';" )
session.execute("INSERT INTO " + self.TB_NAME_META + " " + self.DESCRIPTION_SHORT_META + " VALUES('min_max_runs', '[" + str(new_min) + "," + str(new_max) + "]');" )
session.commit()
except sqlite3.IntegrityError as e:
except Exception as e:
self.log.error("Error occurred: ", e)
session.rollback()
return 1
Expand Down
1 change: 1 addition & 0 deletions requirements
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ Flask==2.0.2
SQLAlchemy==1.4.41
gunicorn==20.1.0
psycopg2-binary
werkzeug==2.0.3

0 comments on commit 39f2a9a

Please sign in to comment.