From c36e85c9126b921cf00e578ac70c1f1ee0153abd Mon Sep 17 00:00:00 2001 From: Daniel Schalla Date: Wed, 10 Oct 2018 19:55:12 +0200 Subject: DeleteAll for KV (#9431) Expire K/V Values Regenerate Code pathfix Update Expiry on Update Check for Exit Signal gofmt Rewrote Go Routine Remove tempoarily cleanup loop fix expiretime TEST: Expired Watchdog as GoRoutine Check if Srv is nil Use Scheduler/Worker for Expired Key CleanUp add license fix scheduler job type; DoJob Restructuring Remove unused imports and constants move db migration from 5.4 to 5.5 --- app/plugin_api.go | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'app/plugin_api.go') diff --git a/app/plugin_api.go b/app/plugin_api.go index 8def80180..70b3d60fe 100644 --- a/app/plugin_api.go +++ b/app/plugin_api.go @@ -331,6 +331,10 @@ func (api *PluginAPI) KVSet(key string, value []byte) *model.AppError { return api.app.SetPluginKey(api.id, key, value) } +func (api *PluginAPI) KVSetWithExpiry(key string, value []byte, expireInSeconds int64) *model.AppError { + return api.app.SetPluginKeyWithExpiry(api.id, key, value, expireInSeconds) +} + func (api *PluginAPI) KVGet(key string) ([]byte, *model.AppError) { return api.app.GetPluginKey(api.id, key) } @@ -339,6 +343,10 @@ func (api *PluginAPI) KVDelete(key string) *model.AppError { return api.app.DeletePluginKey(api.id, key) } +func (api *PluginAPI) KVDeleteAll() *model.AppError { + return api.app.DeleteAllKeysForPlugin(api.id) +} + func (api *PluginAPI) KVList(page, perPage int) ([]string, *model.AppError) { return api.app.ListPluginKeys(api.id, page, perPage) } -- cgit v1.2.3-1-g7c22