🔥 refactor(handlers_web.go): remove commented out code related to testing and updating ToS highlights

🐛 fix(handlers_web.go): remove unused code for updating ToS highlights in the handleService function
This commit is contained in:
pluja 2023-11-12 22:13:08 +01:00
parent 2624a29624
commit 68a31df2e8

View File

@ -106,25 +106,6 @@ func (s *Server) handleService(c *fiber.Ctx) error {
return c.Status(fiber.StatusInternalServerError).SendString("Internal Server Error")
}
// TESTING
//log.Printf("ToS: %v", service.TosHighlights)
//if service.TosHighlights == nil {
// tos, err := tos_scraper.GetBodyHtml(service.TosUrls[0])
// if err != nil {
// log.Error().Err(err).Msg("Could not scrape ToS")
// }
// highlights, err := ai.GetTosHighlights(tos)
// if err != nil {
// log.Error().Err(err).Msg("Could not parse ToS")
// }
// log.Printf("%+v", highlights)
//
// if service.TosHighlights == nil {
// database.Client.Service.UpdateOne(service).SetTosHighlights(&highlights).Save(context.Background())
// }
// service.TosHighlights = &highlights
//}
// Update score in background
upd := c.Query("update", "")
if upd == "true" {