Study-Together-Org / time_counter

12 stars 5 forks source link

Feature: Add redis_to_sql.py script for moving finalized redis sets to sql #62

Closed Ruborcalor closed 3 years ago

Ruborcalor commented 3 years ago

What's this?

usage: redis_to_sql.py [-h] [--date DATE] time

Migrate redis sets to mysql

positional arguments:
  time         The time of the redis set to migrate in format hh:mm:ss

optional arguments:
  -h, --help   show this help message and exit
  --date DATE  The date of the redis set to migrate in format Y-m-d. Default is today's date

Usage

The crontab would be something like:

0 * * * * python redis_to_sql.py `date +%T`

Related Issues

What to review:

How has this been tested?

Zackhardtoname commented 3 years ago

Great work! @Ruborcalor well I think we should delete all the in-session data since they also take up the memory but we don't need to transfer anything from in-session to the SQL since they are just pure temporary data.

Zackhardtoname commented 3 years ago

@Ruborcalor Great! Do you wanna squash and merge just so I don't accidentally steal your credit? I wish there's a way I can do it but assign you as the author, which would be convenient~

Ruborcalor commented 3 years ago

@Ruborcalor Great! Do you wanna squash and merge just so I don't accidentally steal your credit? I wish there's a way I can do it but assign you as the author, which would be convenient~

Sweet thanks yeah i'll squash and merge. Can you mark the PR as approved please?

Zackhardtoname commented 3 years ago

Sweet thanks yeah i'll squash and merge. Can you mark the PR as approved please?

Ah sorry about that!

Ruborcalor commented 3 years ago

Haha you're good just wanted to make it official :)