Sybren A. Stüvel d25151184d Add a "Last Rendered" view
Add a "Last Rendered" view to the webapp.

The Manager now stores (in the database) which job was the last
recipient of a rendered image, and serves that to the appropriate
OpenAPI endpoint.

A new SocketIO subscription + accompanying room makes it possible for
the web interface to receive all rendered images (if they survive the
queue, which discards images when it gets too full).
2022-07-01 12:34:40 +02:00

23 lines
335 B
Go

package persistence
// SPDX-License-Identifier: GPL-3.0-or-later
import (
"fmt"
)
func (db *DB) migrate() error {
err := db.gormDB.AutoMigrate(
&Job{},
&JobBlock{},
&LastRendered{},
&Task{},
&TaskFailure{},
&Worker{},
)
if err != nil {
return fmt.Errorf("failed to automigrate database: %v", err)
}
return nil
}