Public » MiniRedis Read More
Clone URL:  
Pushed to one repository · View In Graph Contained in tip

support LASTSAVE

Changeset 556f775a53ee

Parent a26998c1f7a8

by Profile picture of Benjamin PollackBenjamin Pollack

Changes to one file · Browse files at 556f775a53ee Showing diff from parent a26998c1f7a8 Diff from another changeset...

Change 1 of 4 Show Entire File miniredis.py Stacked
 
13
14
15
 
16
17
18
 
73
74
75
 
76
77
78
 
170
171
172
 
173
174
175
 
241
242
243
 
 
 
244
245
246
 
13
14
15
16
17
18
19
 
74
75
76
77
78
79
80
 
172
173
174
175
176
177
178
 
244
245
246
247
248
249
250
251
252
@@ -13,6 +13,7 @@
 import signal  import socket  import sys +import time    from collections import deque   @@ -73,6 +74,7 @@
  self.clients = {}   self.tables = {}   self.db_file = db_file + self.lastsave = int(time.time())     self.load()   @@ -170,6 +172,7 @@
  if self.db_file:   with open(self.db_file, 'wb') as f:   pickle.dump(self.tables, f, pickle.HIGHEST_PROTOCOL) + self.lastsave = int(time.time())     def select(self, client, db):   if db not in self.tables: @@ -241,6 +244,9 @@
  self.log(client, 'KEYS %s' % pattern)   return ' '.join(k for k in client.table.keys() if r.search(k))   + def handle_lastsave(self, client): + return self.lastsave +   def handle_llen(self, client, key):   if key not in client.table:   return 0