-
Notifications
You must be signed in to change notification settings - Fork 1
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
Sqlite setup #65
Sqlite setup #65
Conversation
…s being called twice with runserver argument for some reason
Now that the statistics are stored in the mysql table, the statistics class doesn't seem necessary. Is it ok to remove it @SergioEstevao11 @ZeAntonioM? The issue seems to be complete and ready to be reviewed |
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.
LGTM, gj! However, it's missing the initialization of the statistics with the cached values.
Created issue #68 for that
Closes #52
What was done
This PR creates a SQLite table to hold the statistics for which majors use TTS the most according to #45. A dump of that table is created at midnight and noon in UTC using Celery and Celery-beat.
What can be improved
The Celery setup that we currently have is the simplest it can be. That said, there is a better setup for django that I have tried to implement but unfortunately I couldn't get it to work. This django setup, although not completely necessary for what we have now, would make the code more organized if we use Celery for more features. I have created an issue #64 to try to use the django configuration for celery.
Testing
To test this PR you can change the local time on your PC to 12:59 (11:59 in UTC) and 00:59 (23:59 in UTC) to make sure that a dump is created exactly at midnight and noon. You can also temporarily remove the arguments in the crontab function in tasks.py so that the dump is created every minute. A file named statistics.sql should be created in tts-be/django/statistics.sql