Skip to content

Commit 2d5a6d9

Browse files
authored
Merge pull request #120 from sommersoft/redis-fix
Fix Redis Connection Error For Bundle Cron
2 parents 30364f3 + 204935b commit 2d5a6d9

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

.github/workflows/bundle_cron.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,5 +50,6 @@ jobs:
5050
env:
5151
ADABOT_EMAIL: ${{ secrets.ADABOT_EMAIL }}
5252
ADABOT_GITHUB_ACCESS_TOKEN: ${{ secrets.ADABOT_GITHUB_ACCESS_TOKEN }}
53+
REDIS_PORT: ${{ job.services.redis.port[6379] }}
5354
run: |
5455
python3 -u -m adabot.circuitpython_bundle

adabot/circuitpython_bundle.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,13 @@
3131
import sh
3232
from sh.contrib import git
3333

34-
import redis
35-
redis = redis.StrictRedis()
34+
import redis as redis_py
35+
36+
redis = None
37+
if "GITHUB_WORKSPACE" in os.environ:
38+
redis = redis_py.StrictRedis(port=os.environ["REDIS_PORT"])
39+
else:
40+
redis = redis_py.StrictRedis()
3641

3742
bundles = ["Adafruit_CircuitPython_Bundle", "CircuitPython_Community_Bundle"]
3843

0 commit comments

Comments
 (0)