Open digitalberd opened 1 month ago
new_key = client.create_key(key_id='123', name=name, data_limit=data_limit_gb) new_key.used_bytes = 0 BUT KEY = client.get_key('123') KEY.used_bytes = X (can be some gigabytes - what was used by old key, before delete key)
I think, it becouse: def init(self, response: dict, metrics: dict = None): self.key_id = response.get("id") self.name = response.get("name") self.password = response.get("password") self.port = response.get("port") self.method = response.get("method") self.access_url = response.get("accessUrl") self.used_bytes = ( metrics.get("bytesTransferredByUserId").get(response.get("id")) if metrics else 0 ) self.data_limit = response.get("dataLimit", {}).get("bytes")
If you use the same ID, the server interprets as the same user. If it's a new user, you can use a new id.
The open feature request for manually resetting the usage information would help with this #1860.
Hello! I created key on server with client.create_key(key_id='123', name=name, data_limit=data_limit_gb) After that I used some trafic by this key - and have used_bytes = X in key After that I delete this key with client.delete_key('123') And after that I created this key again with client.create_key(key_id='123', name=name, data_limit=data_limit_gb)
And I have a problem: new key with id equal old id - '123' - have used_bytes not 0 - it have X used bytes.