@@ -193,8 +193,6 @@ const HEARTBEAT_INTERVAL: Duration = Duration::from_secs(15);
193
193
194
194
pub struct SyncWorker < RT : Runtime > {
195
195
api : Arc < dyn ApplicationApi > ,
196
- // TODO(presley): Delete application once all functionality is migrated to api.
197
- application : Application < RT > ,
198
196
config : SyncWorkerConfig ,
199
197
rt : RT ,
200
198
state : SyncState ,
@@ -243,15 +241,14 @@ impl<RT: Runtime> SyncWorker<RT> {
243
241
rx : UnboundedReceiver < ( ClientMessage , RT :: Instant ) > ,
244
242
tx : SingleFlightSender < RT > ,
245
243
) -> Self {
244
+ let rt = application. runtime ( ) . clone ( ) ;
246
245
// Use api implemented by application until all functionality is migrated
247
246
// and we no longer need application.
248
- let api = Arc :: new ( application. clone ( ) ) ;
249
- let rt = application. runtime ( ) . clone ( ) ;
247
+ let api = Arc :: new ( application) ;
250
248
let ( mutation_sender, receiver) = mpsc:: channel ( OPERATION_QUEUE_BUFFER_SIZE ) ;
251
249
let mutation_futures = receiver. buffered ( 1 ) ; // Execute at most one operation at a time.
252
250
SyncWorker {
253
251
api,
254
- application,
255
252
config,
256
253
rt,
257
254
state : SyncState :: new ( ) ,
@@ -563,8 +560,8 @@ impl<RT: Runtime> SyncWorker<RT> {
563
560
base_version,
564
561
} => {
565
562
let identity = self
566
- . application
567
- . authenticate ( auth_token , self . rt . system_time ( ) )
563
+ . api
564
+ . authenticate ( self . host . as_str ( ) , RequestId :: new ( ) , auth_token )
568
565
. await ?;
569
566
self . state . modify_identity ( identity, base_version) ?;
570
567
self . schedule_update ( ) ;
0 commit comments