mirror of
https://git.rwth-aachen.de/acs/public/villas/web-backend-go/
synced 2025-03-30 00:00:12 +01:00
use time zone in time format for IC updates
This commit is contained in:
parent
ca533f7d5a
commit
d99b769159
2 changed files with 21 additions and 23 deletions
|
@ -96,32 +96,30 @@ var propertiesA = json.RawMessage(`{"prop1" : "a nice prop"}`)
|
|||
var propertiesB = json.RawMessage(`{"prop1" : "not so nice"}`)
|
||||
|
||||
var ICA = database.InfrastructureComponent{
|
||||
UUID: "7be0322d-354e-431e-84bd-ae4c9633138b",
|
||||
WebsocketURL: "https://villas.k8s.eonerc.rwth-aachen.de/ws/ws_sig",
|
||||
APIURL: "https://villas.k8s.eonerc.rwth-aachen.de/ws/api/v2",
|
||||
Type: "villas-node",
|
||||
Category: "gateway",
|
||||
Name: "ACS Demo Signals",
|
||||
Uptime: -1.0,
|
||||
State: "idle",
|
||||
Location: "k8s",
|
||||
Description: "A signal generator for testing purposes",
|
||||
//StateUpdateAt: time.Now().Format(time.RFC1123),
|
||||
UUID: "7be0322d-354e-431e-84bd-ae4c9633138b",
|
||||
WebsocketURL: "https://villas.k8s.eonerc.rwth-aachen.de/ws/ws_sig",
|
||||
APIURL: "https://villas.k8s.eonerc.rwth-aachen.de/ws/api/v2",
|
||||
Type: "villas-node",
|
||||
Category: "gateway",
|
||||
Name: "ACS Demo Signals",
|
||||
Uptime: -1.0,
|
||||
State: "idle",
|
||||
Location: "k8s",
|
||||
Description: "A signal generator for testing purposes",
|
||||
StartParameterScheme: postgres.Jsonb{propertiesA},
|
||||
ManagedExternally: false,
|
||||
}
|
||||
|
||||
var ICB = database.InfrastructureComponent{
|
||||
UUID: "4854af30-325f-44a5-ad59-b67b2597de68",
|
||||
WebsocketURL: "xxx.yyy.zzz.aaa",
|
||||
Type: "dpsim",
|
||||
Category: "simulator",
|
||||
Name: "Test DPsim Simulator",
|
||||
Uptime: -1.0,
|
||||
State: "running",
|
||||
Location: "ACS Laboratory",
|
||||
Description: "This is a test description",
|
||||
//StateUpdateAt: time.Now().Format(time.RFC1123),
|
||||
UUID: "4854af30-325f-44a5-ad59-b67b2597de68",
|
||||
WebsocketURL: "xxx.yyy.zzz.aaa",
|
||||
Type: "dpsim",
|
||||
Category: "simulator",
|
||||
Name: "Test DPsim Simulator",
|
||||
Uptime: -1.0,
|
||||
State: "running",
|
||||
Location: "ACS Laboratory",
|
||||
Description: "This is a test description",
|
||||
StartParameterScheme: postgres.Jsonb{propertiesB},
|
||||
ManagedExternally: true,
|
||||
}
|
||||
|
|
|
@ -143,7 +143,7 @@ func (r *AddICRequest) createIC(receivedViaAMQP bool) (InfrastructureComponent,
|
|||
s.State = "unknown"
|
||||
}
|
||||
// set last update to creation time of IC
|
||||
s.StateUpdateAt = time.Now().Format(time.RFC1123)
|
||||
s.StateUpdateAt = time.Now().Format(time.RFC1123Z)
|
||||
|
||||
return s, err
|
||||
}
|
||||
|
@ -175,7 +175,7 @@ func (r *UpdateICRequest) updatedIC(oldIC InfrastructureComponent) Infrastructur
|
|||
s.Description = r.InfrastructureComponent.Description
|
||||
|
||||
// set last update time
|
||||
s.StateUpdateAt = time.Now().Format(time.RFC1123)
|
||||
s.StateUpdateAt = time.Now().Format(time.RFC1123Z)
|
||||
|
||||
// only update props if not empty
|
||||
var emptyJson postgres.Jsonb
|
||||
|
|
Loading…
Add table
Reference in a new issue