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

feat: bullmq #90

Merged
merged 4 commits into from
Jul 26, 2024
Merged

feat: bullmq #90

merged 4 commits into from
Jul 26, 2024

Conversation

coji
Copy link
Collaborator

@coji coji commented Jul 25, 2024

#43
一旦 bullmq でユーザごとのキューで処理する形にしてみました。

本来の目的である token rate limit などの対応はまだ入っておらず、
実質的に機能性が変わっていないので、ドラフトとしています。

ローカルで example.com を翻訳したときのログ:

bun dev
$ remix vite:dev
  ➜  Local:   http://localhost:5173/
  ➜  Network: use --host to expose
  ➜  press h + enter to show help
11:17:47 PM [vite] ✨ new dependencies optimized: @conform-to/react, @conform-to/zod, zod, @radix-ui/react-scroll-area, @radix-ui/react-progress
11:17:47 PM [vite] ✨ optimized dependencies changed. reloading
11:17:48 PM [vite] ✨ new dependencies optimized: @google/generative-ai, bullmq, @mozilla/readability, jsdom, isomorphic-dompurify
11:17:48 PM [vite] ✨ optimized dependencies changed. reloading
{
  name: 'translate-1',
  data: {
    url: 'https://example.com/',
    targetLanguage: 'ja',
    apiKey: '',
    userId: 1
  },
  opts: { attempts: 0, delay: 0, jobId: undefined, backoff: undefined },
  id: '2',
  progress: 0,
  returnvalue: null,
  stacktrace: null,
  attemptsStarted: 0,
  attemptsMade: 0,
  delay: 0,
  repeatJobKey: undefined,
  timestamp: 1721917070167,
  parentKey: undefined,
  parent: undefined,
  toKey: [Function: bound ],
  queueQualifiedName: 'bull:translation-user-1'
}
Starting job 2 for user 1
article {
  title: 'Example Domain',
  byline: null,
  dir: null,
  lang: null,
  content: '<html><head></head><body><div id="readability-page-1" class="page"><div>\n' +
    '    \n' +
    '    <p>This domain is for use in illustrative examples in documents. You may use this\n' +
    '    domain in literature without prior coordination or asking for permission.</p>\n' +
    '    <p><a href="https://www.iana.org/domains/example">More information...</a></p>\n' +
    '</div></div></body></html>',
  textContent: '\n' +
    '    \n' +
    '    This domain is for use in illustrative examples in documents. You may use this\n' +
    '    domain in literature without prior coordination or asking for permission.\n' +
    '    More information...\n',
  length: 191,
  excerpt: 'This domain is for use in illustrative examples in documents. You may use this\n' +
    '    domain in literature without prior coordination or asking for permission.',
  siteName: null,
  publishedTime: null
}
New PageVersion created: Example Domain
Processing chunk 1 of 1
Job 2 completed successfully for user 1
All translation jobs for user 1 have been completed.
11:17:56 PM [vite] ✨ new dependencies optimized: dompurify, html-react-parser
11:17:56 PM [vite] ✨ optimized dependencies changed. reloading

@ttizze
Copy link
Owner

ttizze commented Jul 25, 2024

うおおお、あざます!!
check失敗してるのとか明日直します!

@coji coji marked this pull request as ready for review July 25, 2024 14:18
@ttizze
Copy link
Owner

ttizze commented Jul 26, 2024

すいません、既存のフォークされたPRにactions当てるのかなりむずそうです、、
cojiさんのほうで
cd web
bun run check
してからプッシュしていただいていいですか?

@ttizze
Copy link
Owner

ttizze commented Jul 26, 2024

あざます!
これチェック通らないっぽいすね、一回外してマージします!

@ttizze ttizze merged commit 221f770 into ttizze:main Jul 26, 2024
2 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants