Skip to content

Commit eba8205

Browse files
committed
docs(redis): remove "fake" redis connection strings
1 parent c7a3721 commit eba8205

File tree

2 files changed

+5
-9
lines changed
  • docs/docs/12_task_queues_emails

2 files changed

+5
-9
lines changed

docs/docs/12_task_queues_emails/04_populate_rq_task_queue/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,10 +76,10 @@ def send_user_registration_email(email, username):
7676
Remember to change "Your Name" in `from` to whatever name you want your emails to come from!
7777
:::
7878

79-
Next up, let's get our Redis connection string and add it to the `.env` file:
79+
Next up, add the Redis connection string that we got in the [previous section](../what_is_task_queue) to the `.env` file:
8080

8181
```text title=".env"
82-
REDIS_URL="rediss://red-ct8aen0hkl10:[email protected]:6379"
82+
REDIS_URL="<insert your Redis url here>"
8383
```
8484

8585
And then let's go to our User resource and add a couple of imports:

docs/docs/12_task_queues_emails/05_rq_background_worker/README.md

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ To do this, we'll run a background worker whose job it is to pop items off the q
88
If you are using MacOS or Linux, you can run the background worker for testing using this command (make sure your virtual environment is active):
99

1010
```bash
11-
rq worker -u rediss://red-ccu1t8a0hklj2a10:[email protected]:6379 emails
11+
rq worker -u <insert your Redis url here> emails
1212
```
1313

1414
The `rq` executable is available after installing the `rq` library with `pip`. The `-u` flag gives it the Redis URL to connect to. The `emails` at the end is the name of the queue that it should consume from. Make sure it matches the name of the queue you defined in `resources/user.py`.
@@ -42,13 +42,9 @@ docker build -t rest-apis-flask-smorest-rq .
4242
Then run a container, but instead of running the default entrypoint (defined by the `CMD` line in the `Dockerfile`), we'll tell it to run the `rq` program:
4343

4444
```bash
45-
docker run -w /app rest-apis-flask-smorest-rq sh -c "rq worker -u rediss://red-caenka10:[email protected]:6379 emails"
45+
docker run -w /app rest-apis-flask-smorest-rq sh -c "rq worker -u <insert your Redis url here> emails"
4646
```
4747

48-
:::info
49-
Make sure to enter your own Redis connection string in that command!
50-
:::
51-
5248
This ensures one of the [considerations](https://python-rq.org/docs/#considerations-for-jobs) that the `rq` documentation suggests: that the worker and the work generator (our API) share _exactly_ the same source code.
5349

5450
Run another Docker container for your API, and try to register!
@@ -68,7 +64,7 @@ docker run -p 5000:5000 rest-apis-flask-smorest-rq sh -c "flask run --host 0.0.0
6864
<TabItem value="worker" label="Run the background worker">
6965

7066
```bash
71-
docker run -w /app rest-apis-flask-smorest-rq sh -c "rq worker -u rediss://red-caenka10:[email protected]:6379 emails"
67+
docker run -w /app rest-apis-flask-smorest-rq sh -c "rq worker -u <insert your Redis url here> emails"
7268
```
7369

7470
:::info

0 commit comments

Comments
 (0)