set -1 cost on error

This commit is contained in:
Radu Ioan Fericean
2013-08-04 22:32:11 +03:00
parent 2156f05131
commit 2d08f0a31e
2 changed files with 3 additions and 3 deletions

View File

@@ -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

View File

@@ -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)
}