mirror of
https://github.com/omg-xtao/ytdlbot.git
synced 2024-11-16 03:45:23 +00:00
only get version, safer upgrade
This commit is contained in:
parent
79496fcd8a
commit
b5aeee2c6e
1
.github/workflows/upgrade.yml
vendored
1
.github/workflows/upgrade.yml
vendored
@ -18,6 +18,7 @@ jobs:
|
|||||||
username: root
|
username: root
|
||||||
key: ${{ secrets.SSH_KEY }}
|
key: ${{ secrets.SSH_KEY }}
|
||||||
script: |
|
script: |
|
||||||
|
docker save bennythink/ytdlbot > ~/ytdlbot-old.tar
|
||||||
cd /home/ytdlbot
|
cd /home/ytdlbot
|
||||||
make bot
|
make bot
|
||||||
make upgrade-all-worker
|
make upgrade-all-worker
|
||||||
|
@ -98,7 +98,6 @@ def current_time():
|
|||||||
return time.strftime("%Y-%m-%d %H:%M:%S", time.localtime())
|
return time.strftime("%Y-%m-%d %H:%M:%S", time.localtime())
|
||||||
|
|
||||||
|
|
||||||
def get_revision_tag():
|
def get_revision():
|
||||||
revision = subprocess.check_output("git -C ../ rev-parse --short HEAD".split()).decode("u8").replace("\n", "")
|
revision = subprocess.check_output("git -C ../ rev-parse --short HEAD".split()).decode("u8").replace("\n", "")
|
||||||
tag = subprocess.check_output("git -C ../ describe --tags".split()).decode("u8").replace("\n", "")
|
return revision
|
||||||
return revision, tag
|
|
||||||
|
@ -27,7 +27,7 @@ from db import MySQL, Redis
|
|||||||
from downloader import convert_flac
|
from downloader import convert_flac
|
||||||
from limit import verify_payment
|
from limit import verify_payment
|
||||||
from tasks import download_entrance
|
from tasks import download_entrance
|
||||||
from utils import (customize_logger, get_revision_tag, get_user_settings,
|
from utils import (customize_logger, get_revision, get_user_settings,
|
||||||
set_user_settings)
|
set_user_settings)
|
||||||
|
|
||||||
customize_logger(["pyrogram.client", "pyrogram.session.session", "pyrogram.connection.connection"])
|
customize_logger(["pyrogram.client", "pyrogram.session.session", "pyrogram.connection.connection"])
|
||||||
@ -220,7 +220,6 @@ def audio_callback(client: "Client", callback_query: types.CallbackQuery):
|
|||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
MySQL()
|
MySQL()
|
||||||
revision_tag = get_revision_tag()
|
|
||||||
scheduler = BackgroundScheduler()
|
scheduler = BackgroundScheduler()
|
||||||
scheduler.add_job(Redis().reset_today, 'cron', hour=0, minute=0)
|
scheduler.add_job(Redis().reset_today, 'cron', hour=0, minute=0)
|
||||||
scheduler.start()
|
scheduler.start()
|
||||||
@ -231,7 +230,7 @@ if __name__ == '__main__':
|
|||||||
▘ ▝▀ ▝▀▘ ▘ ▝▀▘ ▀▀ ▝▀▘ ▀▀ ▝▀ ▘▘ ▘ ▘ ▘ ▝▀ ▝▀▘ ▝▀▘
|
▘ ▝▀ ▝▀▘ ▘ ▝▀▘ ▀▀ ▝▀▘ ▀▀ ▝▀ ▘▘ ▘ ▘ ▘ ▝▀ ▝▀▘ ▝▀▘
|
||||||
|
|
||||||
By @BennyThink, VIP mode: {ENABLE_VIP}, Distribution: {ENABLE_CELERY}
|
By @BennyThink, VIP mode: {ENABLE_VIP}, Distribution: {ENABLE_CELERY}
|
||||||
Version: {revision_tag[0]}@{revision_tag[1]}
|
Version: {get_revision()}
|
||||||
"""
|
"""
|
||||||
print(banner)
|
print(banner)
|
||||||
app.run()
|
app.run()
|
||||||
|
Loading…
Reference in New Issue
Block a user