Skip to content
This repository was archived by the owner on May 16, 2019. It is now read-only.

Commit 9a32e94

Browse files
committed
Fix sql statement in get_followers
1 parent a5237c8 commit 9a32e94

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

db/datastore.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -497,12 +497,8 @@ def get_followers(self, start=0):
497497

498498
f = Followers()
499499
if count > 0:
500-
cursor.execute('''SELECT COALESCE(MAX(rowid)+1, 0) FROM followers''')
501-
max_row = cursor.fetchone()[0]
502-
503-
start = max_row - start
504-
cursor.execute('''SELECT serializedFollower FROM followers WHERE rowid <=? AND rowid > ?''',
505-
(start, start-30))
500+
smt = '''select serializedFollower from followers order by rowid desc limit 30 offset ''' + str(start)
501+
cursor.execute(smt)
506502
serialized_followers = cursor.fetchall()
507503
conn.close()
508504
for proto in serialized_followers:

0 commit comments

Comments
 (0)