diff --git a/deployments/db.js b/deployments/db.js index 11d14b3a..b8ac33f8 100644 --- a/deployments/db.js +++ b/deployments/db.js @@ -114,14 +114,14 @@ db.createCollection( "polling_detail", { } ); //index -db.kv.createIndex({"id": 1}, { unique: true }); -db.kv.createIndex({key: 1, label_format: 1,domain:1,project:1},{ unique: true }); -db.kv_revision.createIndex( { "delete_time": 1 }, { expireAfterSeconds: 7 * 24 * 3600 }); -db.label.createIndex({"id": 1}, { unique: true }); -db.label.createIndex({format: 1,domain:1,project:1},{ unique: true}); -db.polling_detail.createIndex({timestamp: 1}, { expireAfterSeconds: 7 * 24 * 3600}); -db.counter.createIndex({name: 1,domain:1},{ unique: true }); +db.kv.createIndex({"id": 1}, { unique: true } ); +db.kv.createIndex({key: 1, label_format: 1,domain:1,project:1},{ unique: true } ); +db.kv_revision.createIndex( { "delete_time": 1 }, { expireAfterSeconds: 7 * 24 * 3600 } ); +db.label.createIndex({"id": 1}, { unique: true } ); +db.label.createIndex({format: 1,domain:1,project:1},{ unique: true } ); +db.polling_detail.createIndex({timestamp: 1}, { expireAfterSeconds: 7 * 24 * 3600 } ); +db.counter.createIndex({name: 1,domain:1},{ unique: true } ); db.view.createIndex({"id": 1}, { unique: true } ); -db.view.createIndex({display:1,domain:1,project:1},{ unique: true }); +db.view.createIndex({display:1,domain:1,project:1},{ unique: true } ); //db config -db.setProfilingLevel(1, {slowms: 80, sampleRate: 1} ); \ No newline at end of file +db.setProfilingLevel(1, {slowms: 80, sampleRate: 1 } ); \ No newline at end of file diff --git a/pkg/model/db_schema.go b/pkg/model/db_schema.go index d638b690..39becb03 100644 --- a/pkg/model/db_schema.go +++ b/pkg/model/db_schema.go @@ -70,7 +70,7 @@ type PollingDetail struct { URLPath string `json:"url_path,omitempty" bson:"url_path," yaml:"url_path,omitempty"` ResponseBody []*KVDoc `json:"kv,omitempty" bson:"kv," yaml:"kv,omitempty"` ResponseCode int `json:"response_code,omitempty" bson:"response_code," yaml:"response_code,omitempty"` - Timestamp time.Time `json:"timestamp,omitempty" yaml:"timestamp,omitempty"` + Timestamp time.Time `json:"timestamp,omitempty" yaml:"timestamp,omitempty"` } // UpdateKVRequest is db struct, it contains kv update request params diff --git a/server/resource/v1/common.go b/server/resource/v1/common.go index ad03d099..8500e415 100644 --- a/server/resource/v1/common.go +++ b/server/resource/v1/common.go @@ -43,7 +43,7 @@ import ( const ( HeaderUserAgent = "User-Agent" HeaderSessionID = "X-Session-Id" - HeaderSessionGroup = "X-Session-Group" + HeaderSessionGroup = "X-Session-Group" AttributeDomainKey = "domain" FmtReadRequestError = "decode request body failed: %v"