Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/article checker workers with queue #447

Closed
wants to merge 11 commits into from

Conversation

Kseymur
Copy link
Contributor

@Kseymur Kseymur commented Jun 1, 2024

This pull request resolves #425.

When attempting to create a worker that responds to GitHub webhooks and starts processing the diff, I encountered the following limitations:

  • GitHub expects a response to the webhook within 10 seconds. This caused the worker to crash as it couldn't complete the processing in time.

  • Using waitUntil, which could send a response to GitHub immediately and continue processing in the background, is also not feasible in our case due to time constraints. Waiting for a response from OpenAI might take longer.

Considering these limitations, I decided to use a worker with Durable Objects and Alarms. This allows the worker to respond to GitHub immediately and then proceed with processing the diff in the background.

Improvements that can be made:

  • Add full article parsing by links in the RAG part.
  • Add a worker for plagiarism detection.

@Kseymur Kseymur requested a review from evgenydmitriev June 1, 2024 10:56
@evgenydmitriev
Copy link
Contributor

GitHub expects a response to the webhook within 10 seconds. This caused the worker to crash as it couldn't complete the processing in time.

Why do you need to maintain your connection with GitHub? The webhook is only needed to trigger the worker. What you do after (and for how long) is none of GitHub's business. Get whatever you need from GitHub, drop the connection, do your thing, and establish a new connection to post the PR comment whenever you are ready.

@Kseymur Kseymur changed the title Feature/article checker single worker Feature/article checker workers with queue Jun 7, 2024
@Kseymur
Copy link
Contributor Author

Kseymur commented Jun 10, 2024

@evgenydmitriev Rewrote it into a system with two workers and a queue.

@Kseymur Kseymur marked this pull request as draft June 11, 2024 15:22
@Kseymur Kseymur closed this Jun 26, 2024
@Kseymur Kseymur deleted the feature/article-checker-single-worker branch June 26, 2024 14:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Migrate GitHub Actions bot to Cloudflare Workers
2 participants