mirror of
https://github.com/lordmathis/llamactl.git
synced 2025-11-06 00:54:23 +00:00
Initialize timeProvider and logger in UnmarshalJSON for Process
This commit is contained in:
@@ -285,6 +285,14 @@ func (i *Process) UnmarshalJSON(data []byte) error {
|
|||||||
i.options = aux.Options
|
i.options = aux.Options
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Initialize fields that are not serialized
|
||||||
|
if i.timeProvider == nil {
|
||||||
|
i.timeProvider = realTimeProvider{}
|
||||||
|
}
|
||||||
|
if i.logger == nil && i.globalInstanceSettings != nil {
|
||||||
|
i.logger = NewInstanceLogger(i.Name, i.globalInstanceSettings.LogsDir)
|
||||||
|
}
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user