mirror of
https://github.com/coder/coder.git
synced 2025-07-15 22:20:27 +00:00
refactor: workspace autostop_schedule -> ttl (#1578)
Co-authored-by: G r e y <grey@coder.com>
This commit is contained in:
@ -123,6 +123,22 @@ func convertDiffType(left, right any) (newLeft, newRight any, changed bool) {
|
||||
|
||||
return leftStr, rightStr, true
|
||||
|
||||
case sql.NullInt64:
|
||||
var leftInt64Ptr *int64
|
||||
var rightInt64Ptr *int64
|
||||
if !typed.Valid {
|
||||
leftInt64Ptr = nil
|
||||
} else {
|
||||
leftInt64Ptr = ptr(typed.Int64)
|
||||
}
|
||||
|
||||
rightInt64Ptr = ptr(right.(sql.NullInt64).Int64)
|
||||
if !right.(sql.NullInt64).Valid {
|
||||
rightInt64Ptr = nil
|
||||
}
|
||||
|
||||
return leftInt64Ptr, rightInt64Ptr, true
|
||||
|
||||
default:
|
||||
return left, right, false
|
||||
}
|
||||
@ -147,3 +163,7 @@ func derefPointer(ptr reflect.Value) reflect.Value {
|
||||
|
||||
return ptr
|
||||
}
|
||||
|
||||
func ptr[T any](x T) *T {
|
||||
return &x
|
||||
}
|
||||
|
Reference in New Issue
Block a user