mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-17 06:09:53 +05:00
The sessions are no longer terminated on shutdown if the replication_conns are set
This commit is contained in:
committed by
Dan Christian Bogos
parent
3d3540b486
commit
566af40c68
@@ -7,6 +7,7 @@ cgrates (1.0) UNRELEASED; urgency=medium
|
||||
* [AttributeS] Added any_context config to control the matching attributes
|
||||
* [DispatcherS] Added any_subsyste config to control the matching dispatchers
|
||||
* [StatS] AverageCallCost and TotalCallCost now returns error for negative Cost field
|
||||
* [SessionS] The sessions are no longer terminated on shutdown if the replication_conns are set
|
||||
|
||||
-- DanB <danb@cgrates.org> Thu, 4 May 2021 12:05:00 +0200
|
||||
|
||||
|
||||
@@ -110,14 +110,16 @@ func (sS *SessionS) ListenAndServe(stopChan chan struct{}) {
|
||||
|
||||
// Shutdown is called by engine to clear states
|
||||
func (sS *SessionS) Shutdown() (err error) {
|
||||
var hasErr bool
|
||||
for _, s := range sS.getSessions("", false) { // Force sessions shutdown
|
||||
if err = sS.terminateSession(s, nil, nil, nil, false); err != nil {
|
||||
hasErr = true
|
||||
if len(sS.cgrCfg.SessionSCfg().ReplicationConns) == 0 {
|
||||
var hasErr bool
|
||||
for _, s := range sS.getSessions("", false) { // Force sessions shutdown
|
||||
if err = sS.terminateSession(s, nil, nil, nil, false); err != nil {
|
||||
hasErr = true
|
||||
}
|
||||
}
|
||||
if hasErr {
|
||||
return utils.ErrPartiallyExecuted
|
||||
}
|
||||
}
|
||||
if hasErr {
|
||||
return utils.ErrPartiallyExecuted
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user