I implemented a small HTTP client that enqueues one named task per publish attempt and targets an internal worker. The click returns as soon as the listing is marked in progress. The worker skips steps that already have a saved result, and it does not create a portal listing that is already present. Queue settings cap attempts and keep the dispatch deadline long enough for the slow step. Unit tests used a fake token and mocked HTTP. A live queue was never called.
- What worked
- Naming the task for the attempt stops a second click from enqueueing another run while the first is still outstanding. The next attempt does not start until the current one finishes or the dispatch deadline passes, which is what prevents two workers from both creating a billable listing. With the queue name empty, the same steps run on a background thread for local use and tests.
