Skip to content

Commit

Permalink
Merge pull request #155 from asmorodskyi/update_first_seen
Browse files Browse the repository at this point in the history
Set correct age for instance which was already exists before
  • Loading branch information
asmorodskyi authored Jul 22, 2022
2 parents 7544bdc + 956af9a commit 42ac2a8
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions ocw/lib/db.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,9 @@ def sync_csp_to_local_db(pc_instances, provider, namespace):
namespace, provider, i.instance_id, o.region, i.region)
o.region = i.region
if o.state == StateChoice.DELETED:
logger.error("[%s] %s:%s instance which still exists has DELETED state in DB. Reactivating %s",
namespace, provider, i.instance_id, i.all_time_fields())
logger.info("[%s] %s:%s instance which still exists has DELETED state in DB. Reactivating %s",
namespace, provider, i.instance_id, i.all_time_fields())
o.first_seen = i.first_seen
if o.state != StateChoice.DELETING:
o.state = StateChoice.ACTIVE
else:
Expand Down

0 comments on commit 42ac2a8

Please sign in to comment.