mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-11 18:16:24 +05:00
set -1 cost on error
This commit is contained in:
@@ -266,7 +266,7 @@ func (cd *CallDescriptor) GetCost() (*CallCost, error) {
|
||||
destPrefix, err := cd.LoadActivationPeriods()
|
||||
if err != nil {
|
||||
Logger.Err(fmt.Sprintf("error getting cost for key %v: %v", cd.GetUserBalanceKey(), err))
|
||||
return &CallCost{}, err
|
||||
return &CallCost{Cost: -1}, err
|
||||
}
|
||||
timespans := cd.splitInTimeSpans(nil)
|
||||
cost := 0.0
|
||||
|
||||
@@ -134,7 +134,7 @@ func (ms *MongoStorage) GetRatingProfile(key string) (rp *RatingProfile, err err
|
||||
func (ms *MongoStorage) SetRatingProfile(rp *RatingProfile) error {
|
||||
if historyScribe != nil {
|
||||
response := 0
|
||||
go historyScribe.Record(&history.Record{RATING_PROFILE_PREFIX + rp.Id, rp}, &response)
|
||||
historyScribe.Record(&history.Record{RATING_PROFILE_PREFIX + rp.Id, rp}, &response)
|
||||
}
|
||||
return ms.db.C("ratingprofiles").Insert(rp)
|
||||
}
|
||||
@@ -151,7 +151,7 @@ func (ms *MongoStorage) GetDestination(key string) (result *Destination, err err
|
||||
func (ms *MongoStorage) SetDestination(dest *Destination) error {
|
||||
if historyScribe != nil {
|
||||
response := 0
|
||||
go historyScribe.Record(&history.Record{DESTINATION_PREFIX + dest.Id, dest}, &response)
|
||||
historyScribe.Record(&history.Record{DESTINATION_PREFIX + dest.Id, dest}, &response)
|
||||
}
|
||||
return ms.db.C("destinations").Insert(dest)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user