mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-11 10:06:24 +05:00
Added ReplyError as nil in the response of the StringQuery if missing
This commit is contained in:
committed by
Dan Christian Bogos
parent
53e68bd2cf
commit
326c86f583
@@ -162,6 +162,9 @@ func (aS *AnalyzerService) V1StringQuery(args *QueryArgs, reply *[]map[string]in
|
||||
if dur, err := utils.IfaceAsDuration(obj.Fields[utils.RequestDuration]); err == nil {
|
||||
obj.Fields[utils.RequestDuration] = dur.String()
|
||||
}
|
||||
if val, has := obj.Fields[utils.ReplyError]; !has || len(utils.IfaceAsString(val)) == 0 {
|
||||
obj.Fields[utils.ReplyError] = nil
|
||||
}
|
||||
if lCntFltrs != 0 {
|
||||
repDP, err := unmarshalJSON(rep)
|
||||
if err != nil {
|
||||
|
||||
@@ -278,6 +278,7 @@ func TestAnalyzersV1Search(t *testing.T) {
|
||||
"Reply": json.RawMessage(`"Pong"`),
|
||||
"RequestSource": "127.0.0.1:5566",
|
||||
"RequestStartTime": t1.Add(-24 * time.Hour).UTC().Format(time.RFC3339),
|
||||
"ReplyError": nil,
|
||||
}}
|
||||
reply = []map[string]interface{}{}
|
||||
if err = anz.V1StringQuery(&QueryArgs{HeaderFilters: utils.RequestDuration + ":>=" + strconv.FormatInt(int64(time.Hour), 10)}, &reply); err != nil {
|
||||
|
||||
@@ -2515,6 +2515,7 @@ const (
|
||||
RequestDuration = "RequestDuration"
|
||||
RequestParams = "RequestParams"
|
||||
Reply = "Reply"
|
||||
ReplyError = "ReplyError"
|
||||
)
|
||||
|
||||
var (
|
||||
|
||||
Reference in New Issue
Block a user