Currently, we have created a ranking model similar to the following, and we are saving the ranking of each user's games.(Rails 4 Series)
Based on this ranking, we write a program that uses crontab to aggregate once a week.
---ranks --- user_id:integer point:integer --------------
I know where to count, but
I asked you a question because I didn't know the general method of displaying the total results on the screen.
because of the so-called batch processing?, it is not aggregated per access.
I am thinking of creating a model to save the total results and putting the data in it.
I'm still inexperienced, so I don't know if this method is acceptable, and I would appreciate it if you could let me know if there is anything I should be careful about when using this method.
By the way, when we use crontab to aggregate, we write sql without crontab and execute it based on that. I would also like to know if that is the common method... There is no one around me who knows much about it, so I started it without making a decision
ruby-on-rails ruby
I don't know if it's common or not.
I will make a ranking model and table and save the total results.
The display just shows it as it is.
The aggregation itself is done by creating a rake task.This will be done in crontab.
rake task examples:
namespace:ranking do
desc "Total Ranking"
task count_up: —environment do
# actual processing
end
end
There is a gem called whenever to operate the crontab, and I recommend it because it makes it easy to set the crontab.
926 When building Fast API+Uvicorn environment with PyInstaller, console=False results in an error
631 Uncaught (inpromise) Error on Electron: An object could not be cloned
577 Who developed the "avformat-59.dll" that comes with FFmpeg?
620 GDB gets version error when attempting to debug with the Presense SDK (IDE)
© 2024 OneMinuteCode. All rights reserved.