diff --git a/temporal/internal/driver/local/local.go b/temporal/internal/driver/local/local.go index 0340098..9cb2747 100644 --- a/temporal/internal/driver/local/local.go +++ b/temporal/internal/driver/local/local.go @@ -50,72 +50,15 @@ func NewLocalStore(connector model.Connector) *API { // init the key indexes api.Store.Set(keyIndexKey, &Object{ Type: TypeList, - Value: map[string]bool{}, + Value: map[string]interface{}{}, NoExp: true, }) api.Store.Set(deletedKeyIndexKey, &Object{ Type: TypeList, - Value: map[string]bool{}, + Value: map[string]interface{}{}, NoExp: true, }) return api } - -func (api *API) addToKeyIndex(key string) error { - o, err := api.Store.Get(keyIndexKey) - if err != nil { - // not found, create new - o = &Object{ - Type: TypeSet, - Value: map[string]bool{key: true}, - NoExp: true, - } - - return api.Store.Set(keyIndexKey, o) - } - - if o == nil { - o = &Object{ - Type: TypeSet, - Value: map[string]bool{key: true}, - NoExp: true, - } - } - - list := o.Value.(map[string]bool) - list[key] = true - - o.Value = list - - return api.Store.Set(keyIndexKey, o) -} - -func (api *API) updateDeletedKeysIndex(key string) error { - o, err := api.Store.Get(deletedKeyIndexKey) - if err != nil { - // not found, create new - o = &Object{ - Type: TypeSet, - Value: map[string]bool{key: true}, - NoExp: true, - } - - return api.Store.Set(deletedKeyIndexKey, o) - } - - if o == nil { - o = &Object{ - Type: TypeSet, - Value: map[string]bool{key: true}, - NoExp: true, - } - } - - list := o.Value.(map[string]bool) - list[key] = true - o.Value = list - - return api.Store.Set(deletedKeyIndexKey, o) -}