Change timestamp management for resources
When saving an event, update the timestamp on a resource to the event timestamp instead of the current timestamp on the collector host. Change-Id: Ice378cb5be0820d8b817b7c4f635b8a5a8eef3b5 Signed-off-by: Doug Hellmann <doug.hellmann@dreamhost.com>
This commit is contained in:
parent
5b153d5a8c
commit
029ee37337
@ -231,14 +231,15 @@ class Connection(base.Connection):
|
|||||||
)
|
)
|
||||||
|
|
||||||
# Record the updated resource metadata
|
# Record the updated resource metadata
|
||||||
timestamp = datetime.datetime.utcnow()
|
received_timestamp = datetime.datetime.utcnow()
|
||||||
self.db.resource.update(
|
self.db.resource.update(
|
||||||
{'_id': data['resource_id']},
|
{'_id': data['resource_id']},
|
||||||
{'$set': {'project_id': data['project_id'],
|
{'$set': {'project_id': data['project_id'],
|
||||||
'user_id': data['user_id'],
|
'user_id': data['user_id'],
|
||||||
# Current metadata being used and when it was
|
# Current metadata being used and when it was
|
||||||
# last updated.
|
# last updated.
|
||||||
'timestamp': timestamp,
|
'timestamp': data['timestamp'],
|
||||||
|
'received_timestamp': received_timestamp,
|
||||||
'metadata': data['resource_metadata'],
|
'metadata': data['resource_metadata'],
|
||||||
'source': data['source'],
|
'source': data['source'],
|
||||||
},
|
},
|
||||||
|
Loading…
x
Reference in New Issue
Block a user