Auth Cache

This commit is contained in:
암냥 2025-02-02 14:12:18 +09:00 committed by GitHub
commit 96748fb97f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 6 additions and 6 deletions

View file

@ -36,11 +36,11 @@ jobs:
${{ runner.os }}-pip-
# Cache cookie.json
- name: Cache app/temp/cookie.json
- name: Cache app/temp/auth
uses: actions/cache@v3
with:
path: /home/runner/work/today.isangjeong/today.isangjeong/app/temp/cookie.json
key: ${{ runner.os }}-cookie-${{ hashFiles('app/temp/cookie.json') }}
path: /home/runner/work/today.isangjeong/today.isangjeong/app/temp/auth
key: ${{ runner.os }}-cookie-${{ hashFiles('/home/runner/work/today.isangjeong/today.isangjeong/app/temp/auth') }}
restore-keys: |
${{ runner.os }}-cookie-

View file

@ -21,7 +21,7 @@ cl.get_settings()
json.dump(
cl.get_settings(),
open(f'{ROOT}/temp/cookies.json', 'w')
open(f'{ROOT}/temp/auth/cookies.json', 'w')
)
print("🍪 | Account information was successfully retrieved.")

View file

@ -19,7 +19,7 @@ else:
MLSV_YMD = (datetime.now() + timedelta(days=1)).strftime('%Y%m%d')
print("🍪 | Retrieving saved account information.")
cl = Client(json.load(open('./temp/cookies.json')))
cl = Client(json.load(open('./temp/auth/cookies.json')))
cl.set_proxy("socks5h://localhost:9999")
print("🍪 | Account information was successfully retrieved.")

View file

@ -15,7 +15,7 @@ cd ${BOT_ROOT}
# If doesn't have temp/cookies.json, create it
if [ ! -f "./temp/cookies.json" ]; then
if [ ! -f "./temp/auth/cookies.json" ]; then
python3 library/init-auth.py
fi