[release] v0.12.5

This commit is contained in:
Yann Stepienik 2023-11-14 11:16:30 +00:00
parent ec66cc7692
commit 7ade6fcb9c
4 changed files with 19 additions and 4 deletions

View file

@ -1,3 +1,6 @@
## Version 0.12.5
- Added index on event date for faster query
## Version 0.12.4 ## Version 0.12.4
- Fix crash with metrics not seeing any network interface - Fix crash with metrics not seeing any network interface

View file

@ -39,7 +39,7 @@ const EventExplorerStandalone = ({initSearch, initLevel}) => {
<Grid item xs={12} md={12} lg={12}> <Grid item xs={12} md={12} lg={12}>
<EventsExplorer initLevel={initLevel} initSearch={initSearch} from= {from} to= {to}/> <EventsExplorer initLevel={initLevel} initSearch={initSearch} from={from} to={to}/>
</Grid> </Grid>
</Grid> </Grid>
</div> </div>

View file

@ -1,6 +1,6 @@
{ {
"name": "cosmos-server", "name": "cosmos-server",
"version": "0.12.4", "version": "0.12.5",
"description": "", "description": "",
"main": "test-server.js", "main": "test-server.js",
"bugs": { "bugs": {

View file

@ -217,7 +217,7 @@ func initDB() {
} else { } else {
// Create a text index on the _search field // Create a text index on the _search field
model := mongo.IndexModel{ model := mongo.IndexModel{
Keys: bson.M{"_search": "text"}, // Specify the field to index here Keys: bson.M{"_search": "text"},
} }
// Creating the index // Creating the index
@ -226,6 +226,18 @@ func initDB() {
Error("Metrics - Create Index", err) Error("Metrics - Create Index", err)
return // Handle error appropriately return // Handle error appropriately
} }
// Create a date index
model = mongo.IndexModel{
Keys: bson.M{"Date": -1},
}
// Creating the index
_, err = c.Indexes().CreateOne(context.Background(), model)
if err != nil {
Error("Metrics - Create Index", err)
return // Handle error appropriately
}
} }
c, errCo = GetCollection(GetRootAppId(), "metrics") c, errCo = GetCollection(GetRootAppId(), "metrics")
@ -234,7 +246,7 @@ func initDB() {
} else { } else {
// create search index on metrics key // create search index on metrics key
model := mongo.IndexModel{ model := mongo.IndexModel{
Keys: bson.M{"Key": 1}, // Specify the field to index here Keys: bson.M{"Key": 1},
} }
// Creating the index // Creating the index