Skip to content

Upgrade cache prefix for runpod v2 #1594

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

tomkosm
Copy link
Collaborator

@tomkosm tomkosm commented May 23, 2025

Merge after runpod v2 is live

@entelligence-ai-reviews

Walkthrough

This update implements a new versioning scheme for the PDF cache in the GCS integration by updating the cache key prefix and associated metadata. The changes ensure that cached PDF results are clearly separated by version, reducing the risk of conflicts or confusion with previous cache entries. No new logic or functions are introduced; the modifications are limited to string constants for cache key and metadata versioning.

Changes

File(s) Summary
apps/api/src/lib/gcs-pdf-cache.ts Updated PDF cache key prefix from 'pdf-cache/' to 'pdf-cache_v2/' and changed the 'source' metadata field from 'runpod_pdf_conversion' to 'runpod_pdf_conversion_v2' to support new cache versioning.

Sequence Diagram

This diagram shows the interactions between components:

sequenceDiagram
    title PDF Processing and Caching System

    participant Client
    participant PDFProcessor
    participant CacheService
    participant GCSStorage as "Google Cloud Storage"
    
    Client->>PDFProcessor: Request PDF processing
    
    Note over PDFProcessor: Using updated cache prefix<br/>"pdf-cache_v2/"
    
    PDFProcessor->>CacheService: Check if PDF is cached (SHA-256 hash)
    CacheService->>GCSStorage: Look for cached result
    
    alt Cache exists
        GCSStorage-->>CacheService: Return cached result
        CacheService-->>PDFProcessor: Return cached result
        PDFProcessor-->>Client: Return processed PDF data
    else Cache miss
        GCSStorage-->>CacheService: No cache found
        CacheService-->>PDFProcessor: Cache miss
        
        PDFProcessor->>PDFProcessor: Process PDF content
        
        PDFProcessor->>CacheService: Store result in cache
        
        Note over CacheService: Using updated metadata<br/>source: "runpod_pdf_conversion_v2"
        
        CacheService->>GCSStorage: Save JSON result with metadata
        GCSStorage-->>CacheService: Confirm storage
        CacheService-->>PDFProcessor: Confirm caching
        PDFProcessor-->>Client: Return processed PDF data
    end
Loading

▶️AI Code Reviews for VS Code, Cursor, Windsurf
Install the extension

Note for Windsurf Please change the default marketplace provider to the following in the windsurf settings:

Marketplace Extension Gallery Service URL: https://marketplace.visualstudio.com/_apis/public/gallery

Marketplace Gallery Item URL: https://marketplace.visualstudio.com/items

Entelligence.ai can learn from your feedback. Simply add 👍 / 👎 emojis to teach it your preferences. More shortcuts below

Emoji Descriptions:

  • ⚠️ Potential Issue - May require further investigation.
  • 🔒 Security Vulnerability - Fix to ensure system safety.
  • 💻 Code Improvement - Suggestions to enhance code quality.
  • 🔨 Refactor Suggestion - Recommendations for restructuring code.
  • ℹ️ Others - General comments and information.

Interact with the Bot:

  • Send a message or request using the format:
    @entelligenceai + *your message*
Example: @entelligenceai Can you suggest improvements for this code?
  • Help the Bot learn by providing feedback on its responses.
    @entelligenceai + *feedback*
Example: @entelligenceai Do not comment on `save_auth` function !

Also you can trigger various commands with the bot by doing
@entelligenceai command

The current supported commands are

  1. config - shows the current config
  2. retrigger_review - retriggers the review

More commands to be added soon.

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.

2 participants