Skip to content

Commit

Permalink
chore: fix type of dependency in heartbeat model
Browse files Browse the repository at this point in the history
  • Loading branch information
taciturnaxolotl committed Dec 21, 2024
1 parent f0bb225 commit c82f41f
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion models/compat/wakatime/v1/heartbeat.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ type HeartbeatEntry struct {
Lines uint32 `json:"lines"`
LineNumber uint32 `json:"lineno,omitempty"`
CursorPosition uint32 `json:"cursorpos,omitempty"`
Dependencies string `json:"dependencies,omitempty"`
Dependencies []string `json:"dependencies,omitempty"`
Time float64 `json:"time"`
Type string `json:"type"`
UserId string `json:"user_id"`
Expand Down
2 changes: 1 addition & 1 deletion models/heartbeat.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ type Heartbeat struct {
CursorPosition uint32 `json:"cursorpos,omitempty"`
Branch string `json:"branch" gorm:"index:idx_branch"`
Language string `json:"language" gorm:"index:idx_language"`
Dependencies string `json:"dependencies,omitempty" gorm:"type:text"`
Dependencies []string `json:"dependencies,omitempty" gorm:"serializer:json;type:text"`
IsWrite bool `json:"is_write,omitempty"`
Editor string `json:"editor" gorm:"index:idx_editor" hash:"ignore"` // ignored because editor might be parsed differently by wakatime
OperatingSystem string `json:"operating_system" gorm:"index:idx_operating_system" hash:"ignore"` // ignored because os might be parsed differently by wakatime
Expand Down
2 changes: 2 additions & 0 deletions routes/utils/heartbeat_utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ func ParseHeartbeats(r *http.Request) ([]*models.Heartbeat, error) {
r.Body.Close()
r.Body = io.NopCloser(bytes.NewBuffer(body))

fmt.Println(string(body))

conf.Log().Debug("Parsing heartbeat array")

// Try bulk first
Expand Down

0 comments on commit c82f41f

Please sign in to comment.