Sessions: persist only if started
This commit is contained in:
parent
818792dab1
commit
72863b6118
1 changed files with 3 additions and 1 deletions
|
|
@ -89,7 +89,9 @@ func (lp *LoadPoint) updateSession(opts ...sessionOption) {
|
|||
// TODO remove
|
||||
lp.log.DEBUG.Println("session updated")
|
||||
|
||||
lp.db.Persist(lp.session)
|
||||
if !lp.session.Created.IsZero() {
|
||||
lp.db.Persist(lp.session)
|
||||
}
|
||||
}
|
||||
|
||||
// clearSession clears the charging session without persisting it.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue