Get a list of keys which do not have this server name within the key, this means the ban has not been synced to the server, therefore it can be synced after being gathered. Returns: Returns a list of all IPs not relating to the name of this "server" from
(self)
| 100 | bans.append(ban_data[:2]) |
| 101 | |
| 102 | def scan(self): |
| 103 | """ |
| 104 | Get a list of keys which do not have this server name within the key, |
| 105 | this means the ban has not been synced to the server, therefore it can |
| 106 | be synced after being gathered. |
| 107 | |
| 108 | Returns: |
| 109 | Returns a list of all IPs not relating to the name of this "server" from the passed config |
| 110 | """ |
| 111 | |
| 112 | all_results = [] |
| 113 | for result in self.redis_connection.scan_iter(): |
| 114 | if self.redis_connection.type(result) != "hash": |
| 115 | continue |
| 116 | |
| 117 | keys = self.redis_connection.hkeys(result) |
| 118 | if self.name in keys: |
| 119 | continue |
| 120 | |
| 121 | server = self.redis_connection.hget(result, "banned_server") |
| 122 | time_banned = self.redis_connection.hget(result, server) |
| 123 | |
| 124 | self.redis_connection.hset(result, self.name, time_banned) |
| 125 | all_results.append((server, result)) |
| 126 | |
| 127 | return all_results |
| 128 | |
| 129 | |
| 130 | class SqliteConnection: |