-
Notifications
You must be signed in to change notification settings - Fork 371
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(cli): added admin usage to table of admins #795
base: master
Are you sure you want to change the base?
Conversation
Hi, that's great, could you please use sqlalchemy's API rather than executing raw query? |
With this database structure it's a little bit complicated, I think it's not worth it. |
done. |
app/db/models.py
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why we have duplicate function ? there both do same thing
also we have lifetime_used_traffic function and you can calculate reseted_usage way faster
reseted_usage = lifetime_used_traffic - used_traffic
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
that's not same, you have a better idea?
lifetime_used_traffic is not faster :/
lifetime_used_traffic will get all data from database and calculate it in python
by reseted_usage that I add, you will get calculated data from database
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we are doing same thing twice, you can do less job
Another way to avoid more jobs is that we calculate rested usage then for lifetime_used_traffic sum rested usage with used traffic to calculate lifetime_used_traffic
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you can do it yourself.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use power instead of Multiplication
usage // (1024 ** 3)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
actually its better to use from app.utils.system import readable_size
function
I implemented this feature for my self but one of my friends need this. i told her this is going add in official version, when do you think you can work on it? |
guys, i need this |
ما هم همینطور بهش نیاز داریم |
No description provided.