Skip to content

Commit

Permalink
Merge pull request #302 from telefonicaid/issue-301
Browse files Browse the repository at this point in the history
ADD missing geoloc and expiration indexes to Orion service provision
  • Loading branch information
AlvaroVega authored Jan 25, 2021
2 parents aab628d + 073b596 commit 58eaef2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
CHANGES
=======

FIX: create geo-index in Orion DB upon service provision (#301)
FIX: create expiration index in Orion DB upon service provision
Upgrade Dockerfile base image from centos7.7.1908 to centos7.9.2009

3.7.0
Expand Down
2 changes: 2 additions & 0 deletions src/orchestrator/core/mongo.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ def createOrionIndexes(self, SERVICE_NAME):
# For Orion
databaseName = 'orion-' + SERVICE_NAME
db = self.client[databaseName]
db.entities.create_index([("location.coords", pymongo.GEOSPHERE)])
db.entities.create_index("expDate", expireAfterSeconds=0)
db.entities.create_index([("_id.servicePath", pymongo.ASCENDING),
("_id.id", pymongo.ASCENDING),
("_id.type", pymongo.ASCENDING)])
Expand Down

0 comments on commit 58eaef2

Please sign in to comment.