change ignore fresh updated, do update after merge instead.
This commit is contained in:
parent
fed315367a
commit
ed7810cded
3 changed files with 54 additions and 27 deletions
|
|
@ -221,6 +221,16 @@ func (d *Data) GetRecipe(countryID, filename string) *models.Recipe {
|
|||
if currentConfig != requestedConfig {
|
||||
d.taoLogger.Log.Debug("GetRecipe", zap.Any("ActualFileNotMatch", "Skip this!"))
|
||||
} else {
|
||||
|
||||
// detect patches, return original
|
||||
var cached_original_recipe models.Recipe
|
||||
err := d.redisClient.GetKeyTo(filename, &cached_original_recipe)
|
||||
|
||||
if err == nil && d.redisClient.HealthCheck() == nil {
|
||||
d.taoLogger.Log.Debug("GetRecipe.NoReturnUpdated", zap.Any("target", filename))
|
||||
return &cached_original_recipe
|
||||
}
|
||||
|
||||
// if equal, OK
|
||||
return d.CurrentRecipe[countryID]
|
||||
}
|
||||
|
|
@ -239,6 +249,19 @@ func (d *Data) GetRecipe(countryID, filename string) *models.Recipe {
|
|||
if currentConfig != requestedConfig {
|
||||
d.taoLogger.Log.Debug("GetRecipe", zap.Any("InvalidOnStored", "Skip this!"))
|
||||
} else {
|
||||
|
||||
// detect patches, return original
|
||||
|
||||
var cached_original_recipe models.Recipe
|
||||
err := d.redisClient.GetKeyTo(filename, &cached_original_recipe)
|
||||
|
||||
if err == nil && d.redisClient.HealthCheck() == nil {
|
||||
d.taoLogger.Log.Debug("GetRecipe.NoReturnUpdated", zap.Any("target", filename))
|
||||
return &cached_original_recipe
|
||||
}
|
||||
|
||||
d.taoLogger.Log.Debug("GetRecipe.ReturnDefault", zap.Any("error_cache_recipe", err))
|
||||
|
||||
// if equal, OK
|
||||
return recipe.Recipe[countryID]
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue