Skip to content

Commit

Permalink
database: cache feature version upon lookup
Browse files Browse the repository at this point in the history
  • Loading branch information
Quentin-M authored and jzelinskie committed Feb 24, 2016
1 parent 1e4ded6 commit 8f9779e
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions database/pgsql/feature.go
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,11 @@ func (pgSQL *pgSQL) insertFeatureVersion(featureVersion database.FeatureVersion)
if newOrExisting == "exi" {
// That featureVersion already exists, return its id.
tx.Commit()

if pgSQL.cache != nil {
pgSQL.cache.Add(cacheIndex, featureVersion.ID)
}

return featureVersion.ID, nil
}

Expand Down

0 comments on commit 8f9779e

Please sign in to comment.