mirror of
https://git.alemi.dev/dashboard.git
synced 2024-11-24 16:34:49 +01:00
fix: fetch data with reliable ordering
This commit is contained in:
parent
868a1a4e0a
commit
a974dbc5bb
1 changed files with 4 additions and 0 deletions
|
@ -124,6 +124,7 @@ impl AppState {
|
||||||
// TODO parallelize all this stuff
|
// TODO parallelize all this stuff
|
||||||
self.panels = entities::panels::Entity::find()
|
self.panels = entities::panels::Entity::find()
|
||||||
.order_by(entities::panels::Column::Position, Order::Asc)
|
.order_by(entities::panels::Column::Position, Order::Asc)
|
||||||
|
.order_by(entities::panels::Column::Id, Order::Asc)
|
||||||
.all(db).await?;
|
.all(db).await?;
|
||||||
if let Err(e) = self.tx.panels.send(self.panels.clone()) {
|
if let Err(e) = self.tx.panels.send(self.panels.clone()) {
|
||||||
error!(target: "state-manager", "Could not send panels update: {:?}", e);
|
error!(target: "state-manager", "Could not send panels update: {:?}", e);
|
||||||
|
@ -131,6 +132,7 @@ impl AppState {
|
||||||
|
|
||||||
self.sources = entities::sources::Entity::find()
|
self.sources = entities::sources::Entity::find()
|
||||||
.order_by(entities::sources::Column::Position, Order::Asc)
|
.order_by(entities::sources::Column::Position, Order::Asc)
|
||||||
|
.order_by(entities::sources::Column::Id, Order::Asc)
|
||||||
.all(db).await?;
|
.all(db).await?;
|
||||||
if let Err(e) = self.tx.sources.send(self.sources.clone()) {
|
if let Err(e) = self.tx.sources.send(self.sources.clone()) {
|
||||||
error!(target: "state-manager", "Could not send sources update: {:?}", e);
|
error!(target: "state-manager", "Could not send sources update: {:?}", e);
|
||||||
|
@ -138,6 +140,8 @@ impl AppState {
|
||||||
|
|
||||||
self.metrics = entities::metrics::Entity::find()
|
self.metrics = entities::metrics::Entity::find()
|
||||||
.order_by(entities::metrics::Column::Position, Order::Asc)
|
.order_by(entities::metrics::Column::Position, Order::Asc)
|
||||||
|
.order_by(entities::metrics::Column::SourceId, Order::Asc)
|
||||||
|
.order_by(entities::metrics::Column::Id, Order::Asc)
|
||||||
.all(db).await?;
|
.all(db).await?;
|
||||||
if let Err(e) = self.tx.metrics.send(self.metrics.clone()) {
|
if let Err(e) = self.tx.metrics.send(self.metrics.clone()) {
|
||||||
error!(target: "state-manager", "Could not send metrics update: {:?}", e);
|
error!(target: "state-manager", "Could not send metrics update: {:?}", e);
|
||||||
|
|
Loading…
Reference in a new issue