mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-11 18:16:24 +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
ccbccb8ff7
commit
3f06d822d6
@@ -163,6 +163,7 @@ cgrates (0.11.0~dev) 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> Wed, 19 Feb 2020 13:25:52 +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