Skip to content

Commit 14e1c43

Browse files
committed
Integrate ScraperManager into BibleManager for production use
- BibleManager now uses ScraperManager instead of direct BibleScraper - Provides rate limiting, source fallback, and deduplication automatically - All 213 tests passing ✅ Benefits in production: - Automatic rate limiting (1s min delay per domain) prevents server bans - Automatic fallback to BibleHub when BibleGateway fails - Automatic request deduplication prevents duplicate concurrent fetches - Better error handling with exponential backoff
1 parent bd71737 commit 14e1c43

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

mobile/app/src/main/java/com/bytecats/metanoia/bible/BibleManager.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -145,8 +145,8 @@ class BibleManager(private val context: Context) {
145145
arrayOf(book, chapter, verseNum, text, "KJV-Apocrypha"))
146146
}
147147
} else {
148-
val scraper = BibleScraper(client = client)
149-
scraper.scrapeChapter(book, chapter, version) { verseNum, text ->
148+
// Use ScraperManager for rate limiting and fallback
149+
scraperManager.fetchChapter(book, chapter, version) { verseNum, text ->
150150
db.execSQL("INSERT OR REPLACE INTO verses (book, chapter, verse, text, version) VALUES (?, ?, ?, ?, ?)",
151151
arrayOf(book, chapter, verseNum, text, version))
152152
}

0 commit comments

Comments
 (0)