Skip to content

Commit faf8586

Browse files
Crnaneoppolariss
authored andcommitted
feat: disable division cache
1 parent fe7e278 commit faf8586

4 files changed

Lines changed: 16 additions & 4 deletions

File tree

apis/division/apis.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,9 +67,10 @@ func AddDivision(c *fiber.Ctx) error {
6767
// @Success 200 {array} models.Division
6868
func ListDivisions(c *fiber.Ctx) error {
6969
var divisions Divisions
70-
if GetCache("divisions", &divisions) {
71-
return c.JSON(divisions)
72-
}
70+
// Temporarily disable cache
71+
//if GetCache("divisions", &divisions) {
72+
// return c.JSON(divisions)
73+
//}
7374
err := DB.Find(&divisions, "hidden = false").Error
7475
if err != nil {
7576
return err

apis/hole/apis.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1214,5 +1214,10 @@ func GenerateSummary(c *fiber.Ctx) error {
12141214
}
12151215

12161216
func GetFeedback(c *fiber.Ctx) error {
1217+
var body SummaryFeedback
1218+
err := common.ValidateBody(c, &body)
1219+
if err != nil {
1220+
return err
1221+
}
12171222
return c.Status(200).JSON(fiber.Map{})
12181223
}

apis/hole/schemas.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,3 +180,9 @@ type Response struct {
180180
Message string `json:"message"`
181181
Data struct{} `json:"data"`
182182
}
183+
184+
type SummaryFeedback struct {
185+
TraceID string `json:"trace_id"`
186+
Type int `json:"type"`
187+
Reason string `json:"reason"`
188+
}

models/division.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ func (divisions Divisions) Preprocess(c *fiber.Ctx) error {
5757
return err
5858
}
5959
}
60-
return utils.SetCache("divisions", divisions, 0)
60+
return nil //utils.SetCache("divisions", divisions, 0)
6161
}
6262

6363
func (division *Division) Preprocess(c *fiber.Ctx) error {

0 commit comments

Comments
 (0)