Add redis. Prep for new save file
This commit is contained in:
parent
6c22be7d7c
commit
0604a3b77f
5 changed files with 295 additions and 87 deletions
|
|
@ -30,6 +30,7 @@ type RecipeRouter struct {
|
|||
sheetService sheet.SheetService
|
||||
recipeService recipe.RecipeService
|
||||
taoLogger *logger.TaoLogger
|
||||
cache_db *data.RedisCli
|
||||
}
|
||||
|
||||
var (
|
||||
|
|
@ -37,12 +38,13 @@ var (
|
|||
updateMutex = sync.Mutex{}
|
||||
)
|
||||
|
||||
func NewRecipeRouter(data *data.Data, recipeService recipe.RecipeService, sheetService sheet.SheetService, taoLogger *logger.TaoLogger) *RecipeRouter {
|
||||
func NewRecipeRouter(data *data.Data, recipeService recipe.RecipeService, sheetService sheet.SheetService, taoLogger *logger.TaoLogger, cache *data.RedisCli) *RecipeRouter {
|
||||
return &RecipeRouter{
|
||||
data,
|
||||
sheetService,
|
||||
recipeService,
|
||||
taoLogger,
|
||||
cache,
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -460,6 +462,7 @@ func (rr *RecipeRouter) updateRecipe(w http.ResponseWriter, r *http.Request) {
|
|||
|
||||
// gen hash
|
||||
commit_hash, err := data.HashCommit(8)
|
||||
rr.cache_db.SetToKey(commit_hash, targetRecipe)
|
||||
|
||||
commit := data.CommitLog{
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue