MCPcopy Create free account
hub / github.com/QuantumNous/new-api / BeforeCreate

Method BeforeCreate

model/system_task.go:76–85  ·  view source on GitHub ↗
(_ *gorm.DB)

Source from the content-addressed store, hash-verified

74}
75
76func (task *SystemTask) BeforeCreate(_ *gorm.DB) error {
77 now := common.GetTimestamp()
78 if task.CreatedAt == 0 {
79 task.CreatedAt = now
80 }
81 if task.UpdatedAt == 0 {
82 task.UpdatedAt = now
83 }
84 return nil
85}
86
87func (lock *SystemTaskLock) BeforeCreate(_ *gorm.DB) error {
88 if lock.UpdatedAt == 0 {

Callers

nothing calls this directly

Calls 1

GetTimestampFunction · 0.92

Tested by

no test coverage detected