Skip to content

Commit

Permalink
- timedelta(seconds=5))
Browse files Browse the repository at this point in the history
  • Loading branch information
arcangelo7 committed Sep 10, 2023
1 parent b18463f commit 018e43b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "rdflib-ocdm"
version = "0.3.5"
version = "0.3.6"
description = ""
authors = ["arcangelo7 <[email protected]>"]
license = "ISC"
Expand Down
6 changes: 3 additions & 3 deletions rdflib_ocdm/ocdm_graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
from typing import List, Tuple, Optional

from copy import deepcopy
from datetime import datetime, timezone
from datetime import datetime, timezone, timedelta

from rdflib import ConjunctiveGraph, Graph, URIRef

Expand All @@ -47,9 +47,9 @@ def preexisting_finished(self: Graph|ConjunctiveGraph|OCDMGraphCommons, resp_age
count = self.provenance.counter_handler.read_counter(subject)
if count == 0:
if c_time is None:
cur_time: str = datetime.now(tz=timezone.utc).replace(microsecond=0).isoformat(sep="T")
cur_time: str = (datetime.now(tz=timezone.utc).replace(microsecond=0) - timedelta(seconds=5)).isoformat(sep="T")
else:
cur_time: str = datetime.fromtimestamp(c_time, tz=timezone.utc).replace(microsecond=0).isoformat(sep="T")
cur_time: str = (datetime.fromtimestamp(c_time, tz=timezone.utc).replace(microsecond=0) - timedelta(seconds=5)).isoformat(sep="T")
new_snapshot: SnapshotEntity = self.provenance._create_snapshot(subject, cur_time)
new_snapshot.has_description(f"The entity '{str(subject)}' has been created.")

Expand Down

0 comments on commit 018e43b

Please sign in to comment.