Move tracking online users to redis

This commit is contained in:
Jeremy Zhang
2018-01-21 03:14:25 +00:00
parent 6b1c6179d1
commit 2c949d911b
9 changed files with 66 additions and 36 deletions

View File

@ -12,8 +12,7 @@ class UnauthenticatedUsers(Base):
discriminator = db.Column(db.Integer) # The discriminator to distinguish unauth users with each other
user_key = db.Column(db.Text()) # The secret key used to identify the user holder
ip_address = db.Column(db.String(255)) # The IP Address of the user
last_timestamp = db.Column(db.TIMESTAMP) # The timestamp of when the user has last sent the heartbeat
revoked = db.Column(db.Boolean()) # If the user's key has been revoked and a new one is required to be generated
def __repr__(self):
return '<UnauthenticatedUsers {0} {1} {2} {3} {4} {5} {6} {7}>'.format(self.id, self.guild_id, self.username, self.discriminator, self.user_key, self.ip_address, self.last_timestamp, self.revoked)
return '<UnauthenticatedUsers {0} {1} {2} {3} {4} {5} {6}>'.format(self.id, self.guild_id, self.username, self.discriminator, self.user_key, self.ip_address, self.revoked)