[Bug]: crwl always bypasses the cache, -c cache_mode=enabled is ignored
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
調査の方向性
まず、crwl コマンドと crwl crawl コマンドの両方で宣言されている Click オプション --bypass-cache を確認し、次に -c が適用された後に CacheMode.BYPASS を設定している if bypass_cache: ブロックを確認してください。issue にはこれらがどのファイルにあるかは書かれていないため、オプション文字列を検索してください。crwl https://example.com -o md -c cache_mode=enabled を2回実行したときに2回目でキャッシュヒットが発生し、そのフラグのデフォルト値が -c cache_mode を上書きしなくなれば完了です。
索引モデルが issue の本文から書いたものです。
説明
--bypass-cache is declared as a flag with default=True, in both crwl and crwl crawl:
@click.option("--bypass-cache", "-bc", is_flag=True, default=True, help="Bypass cache when crawling")
So bypass_cache is always True, and this runs after -c / --crawler-config are applied:
if bypass_cache:
crawler_cfg.cache_mode = CacheMode.BYPASS
Because of that, -c cache_mode=enabled (or a crawler config file that sets it) is silently ignored, and the CLI never reads or writes the cache.
Repro (0.9.4)
crwl https://example.com -o md -c cache_mode=enabled
crwl https://example.com -o md -c cache_mode=enabled
Both runs fetch the page again, and ~/.crawl4ai/crawl4ai.db never gets a crawled_data table. The same thing from Python works fine: CrawlerRunConfig(cache_mode=CacheMode.ENABLED) gives cache_status miss, then hit.
Fix idea
Make it default=False (keep the flag), or turn it into --bypass-cache/--use-cache. Then only override cache_mode when the user did not set it with -c. Today crwl bypasses the cache by default, so we probably want to keep that as the default and just let -c cache_mode=... win.
Found while looking at the community plugins in #2316. Both of them pass -c cache_mode=enabled and expect caching to work.
- 主要言語
- Python
- スター
- 85.4k
- フォーク
- 8.9k
- 平均マージ
- 6日 5時間
- マージ済み PR(30日)
- 25
環境構築
- Dockerfile または Docker Compose ファイルあり
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
unclecode/crawl4ai のほかの issue
-
[Bug]: Docker memory guard reads host RAM when no container limit is set — cgroup v2 "max" defeats get_container_memory_percent対応中かも @Battleplus が 52 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
unclecode/crawl4ai#2123 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 3/5 1〜2日 初心者へのやさしさ 50/100
メンテナーはふだん 1 日以内に返信
-
🩺 Needs Triage
難易度 5/5 1週間以上 初心者へのやさしさ 12/100
メンテナーはふだん 1 日以内に返信
-
🩺 Needs Triage
難易度 5/5 1週間以上 初心者へのやさしさ 35/100
メンテナーはふだん 1 日以内に返信
-
[docs] DOM XSS: unescaped innerHTML interpolation in docs/apps/linkdin graph view template (5 sinks)対応中かも @chelsealong が 31 日前に担当しました。 オープン🐞 Bug 📌 Root caused
難易度 4/5 3〜5日 初心者へのやさしさ 68/100
unclecode/crawl4ai#2251 · コメント 5 件 ·
メンテナーはふだん 1 日以内に返信
unclecode/crawl4ai の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
aws-samples/sample-per-model-bedrock#243 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 66/100
FuRongJun-1999/dsh-memory#404 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
メンテナーはふだん 1 日以内に返信
-
bug frontend
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
PennyLaneAI/catalyst#3337 ·
メンテナーはふだん 1 日以内に返信
-
Workflow.schedule stops when a cron deadline passes before sleep対応中かも @HuaTNA が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
メンテナーはふだん 1 日以内に返信