Import your Last.fm and Spotify listening history to the AT Protocol network using the fm.teal.alpha.feed.play lexicon.
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

feat: implement aggressive batch configuration for maximum speed

Switch to aggressive defaults with adaptive rate limiting that backs off on failures.

Configuration changes:
- RECORDS_PER_DAY_LIMIT: 1,000 → 10,000 (10x increase)
- SAFETY_MARGIN: 0.9 → 1.0 (remove safety buffer, will adapt)
- DEFAULT_BATCH_SIZE: 10 → 200 (max PDS limit)
- DEFAULT_BATCH_DELAY: 2000ms → 500ms (4x faster)
- MIN_BATCH_DELAY: 1000ms → 500ms
- MAX_BATCH_SIZE: 50 → 200 (PDS maximum)
- BASE_BATCH_SIZE: 10 → 200
- CLIENT_AGENT: v0.1.0 → v0.2.0

Strategy: Start with maximum throughput and dynamically adjust if rate limits are hit.

+15 -13
+15 -13
src/config.ts
··· 6 6 // - This affects all users on your PDS, not just your account 7 7 // - See: https://docs.bsky.app/blog/rate-limits-pds-v3 8 8 // 9 - // Default limit: 1K records per day (automatically batched with pauses) 10 - export const RECORDS_PER_DAY_LIMIT = 1000; 9 + // Default limit: Aggressive initial limit that will dynamically adjust 10 + // Start high and back off if we hit rate limits 11 + export const RECORDS_PER_DAY_LIMIT = 10000; 11 12 12 - // Safety margin factor (0.9 = use 90% of limit to be safe) 13 - export const SAFETY_MARGIN = 0.9; 13 + // Safety margin factor - start aggressive, will back off if needed 14 + export const SAFETY_MARGIN = 1.0; 14 15 15 16 // Record type 16 17 export const RECORD_TYPE = 'fm.teal.alpha.feed.play'; 17 18 18 19 // Client agent 19 - export const CLIENT_AGENT = 'lastfm-importer/v0.1.0'; 20 + export const CLIENT_AGENT = 'lastfm-importer/v0.2.0'; 20 21 21 - // Default batch configuration (will be adjusted for rate limiting) 22 - export const DEFAULT_BATCH_SIZE = 10; 23 - export const DEFAULT_BATCH_DELAY = 2000; // 2 seconds 22 + // Default batch configuration - aggressive defaults for maximum speed 23 + // Will dynamically adjust based on success/failure 24 + export const DEFAULT_BATCH_SIZE = 200; // Max allowed by applyWrites 25 + export const DEFAULT_BATCH_DELAY = 500; // Start with 500ms between batches 24 26 25 - // Minimum safe delay between batches (1 second) 26 - export const MIN_BATCH_DELAY = 1000; 27 + // Minimum safe delay between batches (500ms for adaptive mode) 28 + export const MIN_BATCH_DELAY = 500; 27 29 28 - // Maximum batch size 29 - export const MAX_BATCH_SIZE = 50; 30 + // Maximum batch size (PDS limit is 200 operations per call) 31 + export const MAX_BATCH_SIZE = 200; 30 32 31 33 // Slingshot resolver URL 32 34 export const SLINGSHOT_RESOLVER = 'https://slingshot.microcosm.blue'; ··· 34 36 const config: Config = { 35 37 RECORD_TYPE, 36 38 MIN_RECORDS_FOR_SCALING: 20, 37 - BASE_BATCH_SIZE: 10, 39 + BASE_BATCH_SIZE: 200, // Match DEFAULT_BATCH_SIZE for consistency 38 40 SCALING_FACTOR: 1.5, 39 41 CLIENT_AGENT, 40 42 DEFAULT_BATCH_SIZE,