@@ -24,13 +24,14 @@ type TimerTaskCondition struct {
// TimerSceneService 定时场景实现
type TimerSceneService struct {
- task gmap.HashMap
+ task *gmap.HashMap
cron *gcron.Cron
}
// NewTimerSceneService 创建定时场景
func NewTimerSceneService() *TimerSceneService {
return &TimerSceneService{
+ task: gmap.NewHashMap(true),
cron: gcron.New(),
@@ -76,7 +76,6 @@ func (m *SceneService) SubmitAction(args rpcs.ArgsSubmitSceneAction, reply *rpcs
Action: args.Action,
Time: args.Time,
- fmt.Printf("scene---------: %s\n", gjson.New(scene).MustToJsonString())
srv, err := m.getServiceByType(scene.SceneType)
if err != nil {
server.Log.Errorf("不支持的场景类型: %s, 场景ID: %s", scene.SceneType, scene.Id)