Redis-cli命令重启redis服务器(Redis-cli command to restart the redis server)

我使用redis-cli中的SHUTDOWN终止了redis服务器。 现在提示显示'未连接>'。

我发现重启服务器的唯一方法是退出redis-cli提示符,然后重新启动redis服务。

我的问题是,有没有办法从redis-cli提示符重启服务器使用任何redis命令没有退出redis-cli提示符?


I terminated the redis server using SHUTDOWN from redis-cli. Now the prompt shows 'not connected>'.

The only way I found to restart the server was to exit the redis-cli prompt and then do a restart of the redis service.

My question is, is there any way to restart the server from the redis-cli prompt using any redis commands WITHOUT EXITING the redis-cli prompt?


原文:https://stackoverflow.com/questions/36348783
2023-10-24 14:10

满意答案

mouseover元素时可以设置标记。 像这样的东西:

var disableScroll = true;

$(document).on('mouseenter mouseleave', '.scroll', function(e) {
    disableScroll = (e.type == 'mouseleave');
});

然后检查滚动事件中的标志:

$('.page').on('mousewheel', function(event) {
    if (disableScroll) {
        event.preventDefault();    
    }
});

这是一个更新的小提琴:

http://jsfiddle.net/o0krp0yf/1/

您可能想要添加一个检查以查看内部滚动元素是否已完成滚动(否则,滚动事件将继续到父级,这是不希望的...)


You can set a flag when you mouseover the element. Something like this:

var disableScroll = true;

$(document).on('mouseenter mouseleave', '.scroll', function(e) {
    disableScroll = (e.type == 'mouseleave');
});

And then check against the flag in your scroll event:

$('.page').on('mousewheel', function(event) {
    if (disableScroll) {
        event.preventDefault();    
    }
});

Here's an updated fiddle:

http://jsfiddle.net/o0krp0yf/1/

You might want to add a check to see if the inner scrolling element has completed scrolling (otherwise, the scroll event will continue to the parent, which isn't desired...)

相关问答

更多

在GWT ScrollPanel中使用MouseWheel进行水平滚动?(Horizontal Scroll with MouseWheel in GWT ScrollPanel?)

请参阅此示例,了解如何收听鼠标滚轮事件: http : //examples.roughian.com/index.htm#Listeners~MouseWheelListener 而不是标签扩展ScrollPanel 而不是setText调用setHorizontalScrollPosition(int position) public void onMouseWheel(Widget sender, MouseWheelVelocity velocity) { DOM.eventPre...

平滑的水平滚动绑定到鼠标滚轮(Smooth horizontal scroll bound to mousewheel)

平滑滚动是浏览器特定的功能。 如果你想要一些适用于所有人的东西,那么你需要在你身边做。 jQuery的平滑滚动有多种实现。 实际上,你甚至可能需要所谓的动态滚动。 如果是这样,请尝试jquery.kinetic I'm just going to leave this here. http://jsfiddle.net/Dw4Aj/19/ jQuery(document).ready(function($) { $("html, body").mousewheel(function(e, delt...

Jquery,解开鼠标滚轮事件,然后在动作完成后重新绑定它?(Jquery, unbinding mousewheel event, then rebinding it after actions are completed?)

你需要存储函数,你可以参考它,像这样: function myHandler(event, delta) { $("#wavetextcontainer").unbind("mousewheel", myHandler); var speed = 10; var mySlider = $("#slider"); var sliderVal = mySlider.slider("option", "value"); sli...

Javascript鼠标滚轮事件滚动(Javascript mousewheel event scroll)

mouseover元素时可以设置标记。 像这样的东西: var disableScroll = true; $(document).on('mouseenter mouseleave', '.scroll', function(e) { disableScroll = (e.type == 'mouseleave'); }); 然后检查滚动事件中的标志: $('.page').on('mousewheel', function(event) { if (disableScrol...

有没有办法让鼠标滚轮在Javascript中触发“悬停”事件?(Is there a way to make a mousewheel trigger the “hover” event in Javascript?)

这可能有效: var x = 0, y = 0; $(document).bind('mousemove', function(event) {x = event.clientX; y = event.clientY;}); $(document).bind('mousewheel', function(e1) { var rand = Math.floor(Math.random*2) ? 1 : -1; X = x+rand; Y = y; setTimeo...

jQuery循环 - 用鼠标滚轮控制?(jQuery cycle - control with mousewheel? (How to prevent mousewheel from continuously cycling?))

对于鼠标滚轮的每次移动,您可以设置超时,以延迟任何进一步的用户交互。 这可能需要进一步的时序调整才能完全完善,但试试这个js: if (document.getElementById('hello')) { document.getElementById('hello').innerHTML = 'Hello World - this was inserted using JavaScript'; } $(document).ready(function(){ $('#cycle')...

需要滚动滚动usercontrol(Need to mousewheel scroll a usercontrol)

是的,小组可以有重点。 你只需要把它放在焦点上,我更喜欢在鼠标上使用。 我做到了,解决了问题。 I've been researching this all day, I may have figured this out. The mousewheel event is only sent to the control with focus. A panel can't have focus. Since the panel is covering the usercontrol it can'...

jQuery中的mousewheel问题(Problems with mousewheel in jQuery)

这意味着delta是未定义的,这可能意味着你没有包含正确的插件,或者将它包含在错误的地方。 不知道你下载了什么,我已经尝试过,并且工作正常 。 如果您删除外部资源,它不会像您的情况那样工作。 It means that delta is undefined which probably means you didn't include the proper plugin, or included it in the wrong place. Don't know what you download...

mousewheel和if语句jquery(mousewheel and if statements jquery)

假设scrollDown()函数改变了页面值,解决方案非常明确: if(document.getElementById('pgcount').innerHTML == 'Page 1') scrollDown(2); if(document.getElementById('pgcount').innerHTML == 'Page 2') scrollDown(3); if(document.getElementById('pgcount').innerHTML == 'Page 3') scrol...

检测页面底部的死循环(鼠标滚轮,滚动事件)(Detect dead scrolling at the bottom of the page (mousewheel, scroll events))

下面是我使用的一个脚本,用于在达到底部时停止动画滚动页面: var gate = $(window), edge; setLength(); gate.resize(function() { setLength(); }); function setLength() { edge = $(document).height()-gate.height(); } gate.mousewheel(function(event, delta) { outset = gate.scr...

相关文章

更多

Redis Cookbook

Two years since its initial release, Redis already ...

Redis概述

什么是Redis Redis是Remote Dictionary Server的缩写, Redis是一 ...

redis 集群环境搭建-redis集群管理

集群架构 (1)所有的redis节点彼此互联(PING-PONG机制),内部使用二进制协议优化传输速度 ...

redis安装-redis集群管理

安装redis [root@master opt]# mkdir /opt/redis [root ...

redis sentinel.conf详解-redis集群管理

sentinel.conf详解 官方完整示例

基于linux下redis安装与配置

编译源程序:make install,复制可执行文件,Redis的启动,Redis随机启动

Redis配置文件详解

redis是一款开源的、高性能的键-值存储(key-value store),和memcached类似 ...

基于window安装redis

1、下载redis的window版本 下载地址: https://github.com/Service ...

redis主从从架构搭建-redis集群管理

主从从架构 [root@master redis-master-slave]# vim 6382/re ...

最新问答

更多

获取MVC 4使用的DisplayMode后缀(Get the DisplayMode Suffix being used by MVC 4)

我用Google搜索了一个解决方案。 “EnumDisplayModeProvider”是我自己设置网站的各种模式的枚举。 public EnumDisplayModeProvider GetDisplayModeId() { foreach (var mode in DisplayModeProvider.Instance.Modes) if (mode.CanHandleContext(HttpContext)) {

如何通过引用返回对象?(How is returning an object by reference possible?)

这相对简单:在类的构造函数中,您可以分配内存,例如使用new 。 如果你制作一个对象的副本,你不是每次都分配新的内存,而是只复制指向原始内存块的指针,同时递增一个也存储在内存中的引用计数器,使得每个副本都是对象可以访问它。 如果引用计数降至零,则销毁对象将减少引用计数并仅释放分配的内存。 您只需要一个自定义复制构造函数和赋值运算符。 这基本上是共享指针的工作方式。 This is relatively easy: In the class' constructor, you allocate m

矩阵如何存储在内存中?(How are matrices stored in memory?)

正如它在“熵编码”中所说的那样,使用Z字形图案,与RLE一起使用,在许多情况下,RLE已经减小了尺寸。 但是,据我所知,DCT本身并没有给出稀疏矩阵。 但它通常会增强矩阵的熵。 这是compressen变得有损的点:输入矩阵用DCT传输,然后量化量化然后使用霍夫曼编码。 As it says in "Entropy coding" a zig-zag pattern is used, together with RLE which will already reduce size for man

每个请求的Java新会话?(Java New Session For Each Request?)

你是如何进行重定向的? 您是否事先调用了HttpServletResponse.encodeRedirectURL()? 在这里阅读javadoc 您可以使用它像response.sendRedirect(response.encodeRedirectURL(path)); The issue was with the path in the JSESSIONID cookie. I still can't figure out why it was being set to the tomca

css:浮动div中重叠的标题h1(css: overlapping headlines h1 in floated divs)

我认为word-break ,如果你想在一个单词中打破行,你可以指定它,这样做可以解决问题: .column { word-break:break-all; } jsFiddle演示。 您可以在此处阅读有关word-break属性的更多信息。 I think word-break, with which you can specify if you want to break line within a word, will do the trick: .column { word-break

无论图像如何,Caffe预测同一类(Caffe predicts same class regardless of image)

我认为您忘记在分类时间内缩放输入图像,如train_test.prototxt文件的第11行所示。 您可能应该在C ++代码中的某个位置乘以该因子,或者使用Caffe图层来缩放输入(请查看ELTWISE或POWER图层)。 编辑: 在评论中进行了一次对话之后,结果发现在classification.cpp文件中错误地删除了图像均值,而在原始训练/测试管道中没有减去图像均值。 I think you have forgotten to scale the input image during cl

xcode语法颜色编码解释?(xcode syntax color coding explained?)

转到: Xcode => Preferences => Fonts & Colors 您将看到每个语法高亮颜色旁边都有一个简短的解释。 Go to: Xcode => Preferences => Fonts & Colors You'll see that each syntax highlighting colour has a brief explanation next to it.

在Access 2010 Runtime中使用Office 2000校对工具(Use Office 2000 proofing tools in Access 2010 Runtime)

你考虑过第三方拼写检查吗? 您可以将在C#中开发的自定义WinForms控件插入访问数据库吗? VB6控件怎么样? 如果你能找到一个使用第三方库进行拼写检查的控件,那可能会有效。 Have you considered a third party spell checker? Can you insert a custom WinForms controls developed in C# into an access database? What about a VB6 control? If

从单独的Web主机将图像传输到服务器上(Getting images onto server from separate web host)

我有同样的问题,因为我在远程服务器上有两个图像,我需要在每天的预定义时间复制到我的本地服务器,这是我能够提出的代码... try { if(@copy('url/to/source/image.ext', 'local/absolute/path/on/server/' . date("d-m-Y") . ".gif")) { } else { $errors = error_get_last(); throw new Exception($err

从旧版本复制文件并保留它们(旧/新版本)(Copy a file from old revision and keep both of them (old / new revision))

我不确定我完全明白你在说什么。 你能编辑你的帖子并包含你正在做的Subversion命令/操作的特定顺序吗? 最好使用命令行svn客户端,以便容易为其他人重现问题。 如果您只是想获取文件的旧副本(即使该文件不再存在),您可以使用如下命令: svn copy ${repo}/trunk/moduleA/file1@${rev} ${repo}/trunk/moduleB/file1 其中${repo}是您的存储库的URL, ${rev}是您想要的文件的版本。 这将恢复该文件的旧版本,包括最高版本