database: cache feature version upon lookup

This commit is contained in:
Quentin Machu 2016-01-28 11:29:29 -05:00 committed by Jimmy Zelinskie
parent 1e4ded6f2b
commit 8f9779e232

View File

@ -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
}