{"id":2130,"date":"2013-02-25T10:06:05","date_gmt":"2013-02-25T02:06:05","guid":{"rendered":"http:\/\/www.mudone.com\/?p=2130"},"modified":"2013-02-25T10:06:05","modified_gmt":"2013-02-25T02:06:05","slug":"how-memcached-treat-0-as-never-expired","status":"publish","type":"post","link":"https:\/\/www.mudone.com\/?p=2130","title":{"rendered":"memcached expire time 0"},"content":{"rendered":"<p>\u4eca\u5929\u4e00\u4e2a\u540c\u4e8b\u95ee\u9053\u7f13\u5b58\u8bbe\u7f6e0\u7136\u540e\u5224\u65ad\u6c38\u4e0d\u8fc7\u671f\u7684\u5b9e\u73b0\u673a\u5236\u662f\u600e\u4e48\u6837\u5b50\u7684\uff0c\u5f53\u65f6\u731c\u60f3\u53ef\u80fd\u662f\u8bbe\u7f6e\u4e86\u4e00\u4e2a\u6bd4\u8f83\u5927\u7684\u503c\uff08\u6bd4\u5982\u5341\u5e74\uff09\uff0c\u4e0d\u8fc7\u5bf9\u6b64\u4e0d\u786e\u5b9a\u3002<br \/>\n\u5174\u8d77\u53bbpull\u4e86memcached\u7684\u6e90\u7801\u6765\u770b\uff1a<\/p>\n<p>git pull https:\/\/github.com\/memcached\/memcached.git<\/p>\n<p>memcached.c \u6587\u4ef6 3314 \u884c\uff1a<\/p>\n<blockquote><p>\/*<br \/>\nIf exptime is zero realtime() would return zero too, and<br \/>\nrealtime(exptime) &#8211; 1 would overflow to the max unsigned<br \/>\nvalue. So we process exptime == 0 the same way we do when<br \/>\nno delay is given at all.<br \/>\n*\/<br \/>\nif (exptime &gt; 0)<br \/>\nsettings.oldest_live = realtime(exptime) &#8211; 1;<br \/>\nelse \/* exptime == 0 *\/<br \/>\nsettings.oldest_live = current_time &#8211; 1;<\/p><\/blockquote>\n<p>\u539f\u6765\u662f\u7528\u4e86\u65e0\u7b26\u53f7\u6574\u6570\u7684\u6ea2\u51fa\u3002\u3002\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u4eca\u5929\u4e00\u4e2a\u540c\u4e8b\u95ee\u9053\u7f13\u5b58\u8bbe\u7f6e0\u7136\u540e\u5224\u65ad\u6c38\u4e0d\u8fc7\u671f\u7684\u5b9e\u73b0\u673a\u5236\u662f\u600e\u4e48\u6837\u5b50\u7684\uff0c\u5f53\u65f6\u731c\u60f3\u53ef\u80fd\u662f\u8bbe\u7f6e\u4e86\u4e00\u4e2a\u6bd4\u8f83\u5927\u7684\u503c\uff08\u6bd4\u5982\u5341\u5e74 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_crdt_document":"","footnotes":""},"categories":[9],"tags":[],"class_list":["post-2130","post","type-post","status-publish","format-standard","hentry","category-technote"],"_links":{"self":[{"href":"https:\/\/www.mudone.com\/index.php?rest_route=\/wp\/v2\/posts\/2130","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.mudone.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.mudone.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.mudone.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.mudone.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2130"}],"version-history":[{"count":1,"href":"https:\/\/www.mudone.com\/index.php?rest_route=\/wp\/v2\/posts\/2130\/revisions"}],"predecessor-version":[{"id":2131,"href":"https:\/\/www.mudone.com\/index.php?rest_route=\/wp\/v2\/posts\/2130\/revisions\/2131"}],"wp:attachment":[{"href":"https:\/\/www.mudone.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2130"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.mudone.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2130"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.mudone.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2130"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}