Merge pull request #188 from cloudflare/sven/add-suffix-queue

Add name suffix to queue
pull/194/head
Sven Sauleau 2023-02-03 17:57:37 +00:00 zatwierdzone przez GitHub
commit b79c41ecb4
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 4AEE18F83AFDEB23
2 zmienionych plików z 10 dodań i 9 usunięć

Wyświetl plik

@ -238,7 +238,7 @@ jobs:
- name: Create Queue - name: Create Queue
uses: cloudflare/wrangler-action@2.0.0 uses: cloudflare/wrangler-action@2.0.0
with: with:
command: queues create wildebeest command: queues create wildebeest-${{ env.NAME_SUFFIX }}
apiToken: ${{ secrets.CF_API_TOKEN }} apiToken: ${{ secrets.CF_API_TOKEN }}
continue-on-error: true continue-on-error: true
env: env:
@ -250,6 +250,14 @@ jobs:
apiToken: ${{ secrets.CF_API_TOKEN }} apiToken: ${{ secrets.CF_API_TOKEN }}
preCommands: | preCommands: |
echo "*** pre commands ***" echo "*** pre commands ***"
echo -e "name = \"wildebeest-consumer-${{ env.NAME_SUFFIX }}\"\n" >> consumer/wrangler.toml
echo -e "[[queues.consumers]]\n" >> consumer/wrangler.toml
echo -e "max_batch_size = 10\n" >> consumer/wrangler.toml
echo -e "max_batch_timeout = 30\n" >> consumer/wrangler.toml
echo -e "max_retries = 10\n" >> consumer/wrangler.toml
echo -e "queue = \"wildebeest-${{ env.NAME_SUFFIX }}\"\n" >> consumer/wrangler.toml
echo -e "[[d1_databases]]\nbinding=\"DATABASE\"\ndatabase_name=\"wildebeest-${{ env.NAME_SUFFIX }}\"\ndatabase_id=\"${{ env.d1_id }}\"\n" >> consumer/wrangler.toml echo -e "[[d1_databases]]\nbinding=\"DATABASE\"\ndatabase_name=\"wildebeest-${{ env.NAME_SUFFIX }}\"\ndatabase_id=\"${{ env.d1_id }}\"\n" >> consumer/wrangler.toml
echo -e "[durable_objects]\n" >> consumer/wrangler.toml echo -e "[durable_objects]\n" >> consumer/wrangler.toml
@ -275,7 +283,7 @@ jobs:
"production": { "production": {
"queue_producers": { "queue_producers": {
"QUEUE": { "QUEUE": {
"name": "wildebeest" "name": "wildebeest-${{ env.NAME_SUFFIX }}"
} }
} }
} }

Wyświetl plik

@ -1,10 +1,3 @@
name = "wildebeest-consumer"
compatibility_date = "2023-01-09" compatibility_date = "2023-01-09"
main = "./src/index.ts" main = "./src/index.ts"
usage_model = "unbound" usage_model = "unbound"
[[queues.consumers]]
queue = "wildebeest"
max_batch_size = 10
max_batch_timeout = 30
max_retries = 10