MCPcopy Create free account
hub / github.com/SwishHQ/spread / CheckUpdate

Method CheckUpdate

src/controller/client_controller.go:27–47  ·  view source on GitHub ↗
(ctx *fiber.Ctx)

Source from the content-addressed store, hash-verified

25 }
26}
27func (c *clientController) CheckUpdate(ctx *fiber.Ctx) error {
28 environmentKey := ctx.Query("deployment_key")
29 appVersion := ctx.Query("app_version")
30 bundleHash := ctx.Query("package_hash")
31 label := ctx.Query("label")
32 clientUniqueId := ctx.Query("client_unique_id")
33
34 logger.L.Info("In CheckUpdate", zap.String("environmentKey", environmentKey), zap.String("appVersion", appVersion), zap.String("bundleHash", bundleHash), zap.String("label", label), zap.String("clientUniqueId", clientUniqueId))
35 updateInfo, err := c.clientService.CheckUpdate(environmentKey, appVersion, bundleHash)
36 if err != nil {
37 logger.L.Error("In CheckUpdate: Error checking update", zap.Error(err))
38 // when update_info is nil, it means there is no update available
39 // to be safe of sdk crashing upon any irrelavent error, we return nil
40 return ctx.Status(fiber.StatusOK).JSON(fiber.Map{
41 "update_info": nil,
42 })
43 }
44 return ctx.Status(fiber.StatusOK).JSON(fiber.Map{
45 "update_info": updateInfo,
46 })
47}
48
49func (c *clientController) ReportStatusDeploy(ctx *fiber.Ctx) error {
50 reportStatusRequest := new(types.ReportStatusDeployRequest)

Callers

nothing calls this directly

Calls 1

CheckUpdateMethod · 0.65

Tested by

no test coverage detected