work: Update route and messages

This commit is contained in:
Daniel Friesel 2019-04-26 22:12:34 +02:00
parent a760274c7c
commit e500c2e537

View file

@ -44,8 +44,18 @@ sub run {
$db->update( $db->update(
'in_transit', 'in_transit',
{ real_departure => $train->departure }, {
{ user_id => $uid } real_departure => $train->departure,
route => join( '|', $train->route ),
messages => join(
'|',
map {
( $_->[0] ? $_->[0]->epoch : q{} ) . ':'
. $_->[1]
} $train->messages
)
},
{ user_id => $uid }
); );
} }
}; };
@ -78,6 +88,14 @@ sub run {
{ {
sched_arrival => $train->sched_arrival, sched_arrival => $train->sched_arrival,
real_arrival => $train->arrival, real_arrival => $train->arrival,
route => join( '|', $train->route ),
messages => join(
'|',
map {
( $_->[0] ? $_->[0]->epoch : q{} ) . ':'
. $_->[1]
} $train->messages
)
}, },
{ user_id => $uid } { user_id => $uid }
); );