Skip to content

Commit

Permalink
fix for python39
Browse files Browse the repository at this point in the history
  • Loading branch information
rafaelweingartner committed Feb 13, 2025
1 parent 569a94f commit 81ff496
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
def upgrade():
sql_column = sqlalchemy.Column(
"last_measure_timestamp", sqlalchemy.DateTime,
nullable=False, default=datetime.datetime.now(datetime.UTC),
nullable=False, default=datetime.datetime.utcnow(),
server_default=sqlalchemy.sql.func.current_timestamp())
op.add_column(
"metric", sql_column)
2 changes: 1 addition & 1 deletion gnocchi/indexer/sqlalchemy_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ class Metric(Base, GnocchiBase, indexer.Metric):
# measurements; thus, if all metric for a resource are in this situation,
# chances are that the resource ceased existing in the backend.
last_measure_timestamp = sqlalchemy.Column(
"last_measure_timestamp", sqlalchemy.DateTime, default=datetime.datetime.now(datetime.UTC), nullable=False,
"last_measure_timestamp", sqlalchemy.DateTime, default=datetime.datetime.utcnow(), nullable=False,
server_default=sqlalchemy.sql.func.current_timestamp())

def jsonify(self):
Expand Down

0 comments on commit 81ff496

Please sign in to comment.