How to call BGSAVE from BookSleeve?

与世无争的帅哥 提交于 2019-12-11 13:54:21

问题


Anyone can tell me how to call command BGSAVE from BookSleeve to Redis?

I search a lot in BookSleeve available methods but not found any commands relative to SAVE or BGSAVE.

Thanks!


回答1:


Yes, it would seem that I never got around to adding that; I don't think SHUTDOWN is there either. In both cases, I expect they simply weren't things that are commonly performed at the reqest if a client - but are usually either automated (persistence configuration), or instigated at the command line (manually or as part of a script) as part of routine maintenance operations.

I can get it added for the next build (probably with the "connection has admin commands enabled" check).

A truly hacky workaround for now (untested) would be:

.Scripting.Eval(0, "return redis.call('bgsave')", null, null);

(caveat: the above makes me shudder)

But again: if your application is just performing routine work, I would probably recommend using automatic redis persistence settings. If your application is a monitoring / maintenance front end, then SAVE doesn't seem too inappropriate.

but not found any commands relative to SAVE or BGSAVE.

Actually, I would strongly advise avoiding SAVE on a production server, unless you know it is safely off to one side and not being used; BGSAVE is not so invasive.



来源:https://stackoverflow.com/questions/19804356/how-to-call-bgsave-from-booksleeve

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!