mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-15 13:19:53 +05:00
Added time.Now() as CGREvent time for all console commands using it
This commit is contained in:
committed by
Dan Christian Bogos
parent
eeee8b9945
commit
8f8b821f17
@@ -19,6 +19,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>
|
||||
package console
|
||||
|
||||
import (
|
||||
"time"
|
||||
|
||||
"github.com/cgrates/cgrates/engine"
|
||||
"github.com/cgrates/cgrates/utils"
|
||||
)
|
||||
@@ -56,6 +58,9 @@ func (self *CmdAttributesProcessEvent) RpcParams(reset bool) interface{} {
|
||||
}
|
||||
|
||||
func (self *CmdAttributesProcessEvent) PostprocessRpcParams() error { //utils.CGREvent
|
||||
if self.rpcParams.Time == nil {
|
||||
self.rpcParams.Time = utils.TimePointer(time.Now())
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
|
||||
@@ -19,6 +19,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>
|
||||
package console
|
||||
|
||||
import (
|
||||
"time"
|
||||
|
||||
"github.com/cgrates/cgrates/engine"
|
||||
"github.com/cgrates/cgrates/utils"
|
||||
)
|
||||
@@ -57,6 +59,9 @@ func (self *CmdGetResourceForEvent) RpcParams(reset bool) interface{} {
|
||||
}
|
||||
|
||||
func (self *CmdGetResourceForEvent) PostprocessRpcParams() error {
|
||||
if self.rpcParams.CGREvent.Time == nil {
|
||||
self.rpcParams.CGREvent.Time = utils.TimePointer(time.Now())
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
|
||||
@@ -19,6 +19,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>
|
||||
package console
|
||||
|
||||
import (
|
||||
"time"
|
||||
|
||||
"github.com/cgrates/cgrates/utils"
|
||||
)
|
||||
|
||||
@@ -56,6 +58,9 @@ func (self *CmdStatQueueProcessEvent) RpcParams(reset bool) interface{} {
|
||||
}
|
||||
|
||||
func (self *CmdStatQueueProcessEvent) PostprocessRpcParams() error {
|
||||
if self.rpcParams.Time == nil {
|
||||
self.rpcParams.Time = utils.TimePointer(time.Now())
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
|
||||
@@ -19,14 +19,17 @@ along with this program. If not, see <http://www.gnu.org/licenses/>
|
||||
package console
|
||||
|
||||
import (
|
||||
"time"
|
||||
|
||||
"github.com/cgrates/cgrates/engine"
|
||||
"github.com/cgrates/cgrates/utils"
|
||||
)
|
||||
|
||||
func init() {
|
||||
c := &CmdThresholdProcessEvent{
|
||||
name: "thresholds_process_event",
|
||||
rpcMethod: "ThresholdSv1.ProcessEvent",
|
||||
rpcParams: &engine.ArgsProcessEvent{},
|
||||
rpcParams: new(engine.ArgsProcessEvent),
|
||||
}
|
||||
commands[c.Name()] = c
|
||||
c.CommandExecuter = &CommandExecuter{c}
|
||||
@@ -55,6 +58,9 @@ func (self *CmdThresholdProcessEvent) RpcParams(reset bool) interface{} {
|
||||
}
|
||||
|
||||
func (self *CmdThresholdProcessEvent) PostprocessRpcParams() error {
|
||||
if self.rpcParams.Time == nil {
|
||||
self.rpcParams.Time = utils.TimePointer(time.Now())
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user