mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-22 15:48:44 +05:00
Move TPReader.Init() outside of ReloadCache
This commit is contained in:
@@ -354,6 +354,8 @@ func (apiv1 *ApierV1) LoadTariffPlanFromStorDb(attrs AttrLoadTpFromStorDb, reply
|
||||
return utils.NewErrServerError(err)
|
||||
}
|
||||
}
|
||||
// release the reader with it's structures
|
||||
dbReader.Init()
|
||||
*reply = utils.OK
|
||||
return nil
|
||||
}
|
||||
@@ -885,6 +887,8 @@ func (apiv1 *ApierV1) LoadTariffPlanFromFolder(attrs utils.AttrLoadTpFromFolder,
|
||||
return utils.NewErrServerError(err)
|
||||
}
|
||||
}
|
||||
// release the reader with it's structures
|
||||
loader.Init()
|
||||
*reply = utils.OK
|
||||
return nil
|
||||
}
|
||||
@@ -948,6 +952,8 @@ func (apiv1 *ApierV1) RemoveTPFromFolder(attrs utils.AttrLoadTpFromFolder, reply
|
||||
return utils.NewErrServerError(err)
|
||||
}
|
||||
}
|
||||
// release the reader with it's structures
|
||||
loader.Init()
|
||||
*reply = utils.OK
|
||||
return nil
|
||||
}
|
||||
@@ -997,7 +1003,8 @@ func (apiv1 *ApierV1) RemoveTPFromStorDB(attrs AttrLoadTpFromStorDb, reply *stri
|
||||
return utils.NewErrServerError(err)
|
||||
}
|
||||
}
|
||||
|
||||
// release the reader with it's structures
|
||||
dbReader.Init()
|
||||
*reply = utils.OK
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -150,6 +150,8 @@ func (self *ApierV2) LoadTariffPlanFromFolder(attrs utils.AttrLoadTpFromFolder,
|
||||
return utils.NewErrServerError(err)
|
||||
}
|
||||
}
|
||||
// release the reader with it's structures
|
||||
loader.Init()
|
||||
loadHistList, err := self.DataManager.DataDB().GetLoadHistory(1, true, utils.NonTransactional)
|
||||
if err != nil {
|
||||
return err
|
||||
|
||||
@@ -378,6 +378,8 @@ func main() {
|
||||
log.Fatal("Could not reload scheduler: ", err)
|
||||
}
|
||||
}
|
||||
// release the reader with it's structures
|
||||
tpReader.Init()
|
||||
} else {
|
||||
if err := tpReader.RemoveFromDatabase(*verbose, *disableReverse); err != nil {
|
||||
log.Fatal("Could not delete from database: ", err)
|
||||
|
||||
@@ -81,4 +81,10 @@
|
||||
},
|
||||
|
||||
|
||||
"apier": {
|
||||
"scheduler_conns": [
|
||||
{"address": "*internal"},
|
||||
],
|
||||
},
|
||||
|
||||
}
|
||||
|
||||
@@ -81,4 +81,11 @@
|
||||
},
|
||||
|
||||
|
||||
"apier": {
|
||||
"scheduler_conns": [
|
||||
{"address": "*internal"},
|
||||
],
|
||||
},
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -154,4 +154,6 @@
|
||||
{"address": "*internal"},
|
||||
],
|
||||
},
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -2512,8 +2512,6 @@ func (tpr *TpReader) ReloadCache(caching string, verbose bool, argDispatcher *ut
|
||||
Cache.Set(utils.CacheLoadIDs, key, val, nil,
|
||||
cacheCommit(utils.NonTransactional), utils.NonTransactional)
|
||||
}
|
||||
// release the reader with it's structures
|
||||
tpr.Init()
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user