diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 6ea0281..163b2e2 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -238,7 +238,7 @@ jobs: - name: Create Queue uses: cloudflare/wrangler-action@2.0.0 with: - command: queues create wildebeest + command: queues create wildebeest-${{ env.NAME_SUFFIX }} apiToken: ${{ secrets.CF_API_TOKEN }} continue-on-error: true env: @@ -250,6 +250,14 @@ jobs: apiToken: ${{ secrets.CF_API_TOKEN }} preCommands: | 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 "[durable_objects]\n" >> consumer/wrangler.toml @@ -275,7 +283,7 @@ jobs: "production": { "queue_producers": { "QUEUE": { - "name": "wildebeest" + "name": "wildebeest-${{ env.NAME_SUFFIX }}" } } } diff --git a/consumer/wrangler.toml b/consumer/wrangler.toml index c94b6f4..7a861f3 100644 --- a/consumer/wrangler.toml +++ b/consumer/wrangler.toml @@ -1,10 +1,3 @@ -name = "wildebeest-consumer" compatibility_date = "2023-01-09" main = "./src/index.ts" usage_model = "unbound" - -[[queues.consumers]] - queue = "wildebeest" - max_batch_size = 10 - max_batch_timeout = 30 - max_retries = 10