forked from newthuhole/hole_thu_backend
热度衰减脚本
This commit is contained in:
9
hot_score_attenuation.py
Normal file
9
hot_score_attenuation.py
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
from hole import app
|
||||||
|
from models import Post, db
|
||||||
|
|
||||||
|
with app.app_context():
|
||||||
|
for p in Post.query.filter(
|
||||||
|
Post.hot_score > 0
|
||||||
|
).all():
|
||||||
|
p.hot_score = int(p.hot_score * 0.9)
|
||||||
|
db.session.commit()
|
||||||
Reference in New Issue
Block a user