Skip to content

Validating the Cache

Brennan Chapman edited this page Apr 15, 2015 · 4 revisions

Validating the cache can be performed in two ways

  • Count Validation
  • Field Validation

NOTE: Any EventLogEntry's recorded during data/count retrieval is factored in.
This fixes the potential loopholes created by the limitation of not being able to load data from a snapshotted point in time.

Count Validation

This is the quickest form of validation, and the most lightweight.
It simply retrieves the current entity counts that should be cached from shotgun and compares it to the counts of what's actually stored in the cache db.

Because this is a lightweight and fast check, by default all entity types will be validated in this mode.

$ shotgunCache validate-counts

You can supply specific entity types to check separated by spaces

$ shotgunCache validate-counts Asset Shot

Field Validation

This Field a much heavier process, and can take a lot longer.
This will retrieve data for a list of fields from both Shotgun and the cache and compare them.
Also, this reports any missing entities per entity ID.
Where validate-counts only compares the total entity counts, validate-fields will make sure ID's actually match as well.

By default, only the type and id fields are validated for all entities that should be cached per entity type.

$ shotgunCache validate-fields Asset

You can specify which fields to validate by passing a comma separated list of fields (no spaces).

$ shotgunCache validate-fields Asset --fields code,user

You can also provide a list of filters.
These will be combined with the existing cache filters for each entity.

$ shotgunCache validate-fields Asset --filters '[["id", "between", (2000,4000)]]'

Clone this wiki locally