Skip to content
This repository was archived by the owner on Jan 23, 2024. It is now read-only.

Commit 9906286

Browse files
committed
ちょっと改善
1 parent 1b0fdd5 commit 9906286

2 files changed

Lines changed: 11 additions & 1 deletion

File tree

webapp/go/user_handler.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,12 @@ func getIconHandler(c echo.Context) error {
117117
return echo.NewHTTPError(http.StatusInternalServerError, "failed to glob: "+err.Error())
118118
}
119119
if len(files) == 0 {
120+
if ifNoneMatchValue == "d9f8294e9d895f81ce62e73dc7d5dff862a4fa40bd4e0fecf53f7526a8edcac0" {
121+
return c.NoContent(http.StatusNotModified)
122+
}
123+
// c.Response().Header().Set("x-accel-redirect", fmt.Sprintf("/img/%s", filepath.Base(fallbackImage)))
124+
// return c.NoContent(http.StatusOK)
125+
120126
return c.File(fallbackImage)
121127
}
122128

@@ -139,6 +145,9 @@ func getIconHandler(c echo.Context) error {
139145
// }
140146

141147
return c.Blob(http.StatusOK, "image/jpeg", image)
148+
149+
// c.Response().Header().Set("x-accel-redirect", fmt.Sprintf("/img/%s", filepath.Base(files[0])))
150+
// return c.NoContent(http.StatusOK)
142151
}
143152

144153
func postIconHandler(c echo.Context) error {

webapp/sql/initdb.d/10_schema.sql

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,8 @@ CREATE TABLE `reservation_slots` (
5656
`id` BIGINT NOT NULL AUTO_INCREMENT PRIMARY KEY,
5757
`slot` BIGINT NOT NULL,
5858
`start_at` BIGINT NOT NULL,
59-
`end_at` BIGINT NOT NULL
59+
`end_at` BIGINT NOT NULL,
60+
INDEX `idx_reservation_slots_start_end` (`start_at`, `end_at`)
6061
) ENGINE=InnoDB CHARACTER SET utf8mb4 COLLATE utf8mb4_bin;
6162

6263
-- ライブストリームに付与される、サービスで定義されたタグ

0 commit comments

Comments
 (0)