Skip to content

Cache CLI once built #3

Description

@YoshiWalsh

I have a text file of ~1,000 "original file names" , and I need to transform this into a text file containing the Immich asset ID that corresponds to these. Unfortunately, immich-rest-cli search assets --original-file-name $FILENAME only lets me search for a single file name at a time, so this requires ~1,000 API requests.

But at the moment, each time I invoke immich-rest-cli, it takes multiple seconds to run. This is because it has to fetch & parse the spec, generate models, build the registry, etc... each time before it can dispatch my request.

This work is unnecessary, as the API spec only changes when the Immich server is updated.

The easiest way to solve this would be to cache the important data once it has been loaded & transformed. Even with a cache validity of just one hour would drastically speed up repeated calls.

A command should also be added to skip the cache and force a rebuild of the CLI.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions