@@ -193,8 +193,6 @@ const HEARTBEAT_INTERVAL: Duration = Duration::from_secs(15);
193193
194194pub struct SyncWorker < RT : Runtime > {
195195 api : Arc < dyn ApplicationApi > ,
196- // TODO(presley): Delete application once all functionality is migrated to api.
197- application : Application < RT > ,
198196 config : SyncWorkerConfig ,
199197 rt : RT ,
200198 state : SyncState ,
@@ -243,15 +241,14 @@ impl<RT: Runtime> SyncWorker<RT> {
243241 rx : UnboundedReceiver < ( ClientMessage , RT :: Instant ) > ,
244242 tx : SingleFlightSender < RT > ,
245243 ) -> Self {
244+ let rt = application. runtime ( ) . clone ( ) ;
246245 // Use api implemented by application until all functionality is migrated
247246 // 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) ;
250248 let ( mutation_sender, receiver) = mpsc:: channel ( OPERATION_QUEUE_BUFFER_SIZE ) ;
251249 let mutation_futures = receiver. buffered ( 1 ) ; // Execute at most one operation at a time.
252250 SyncWorker {
253251 api,
254- application,
255252 config,
256253 rt,
257254 state : SyncState :: new ( ) ,
@@ -563,8 +560,8 @@ impl<RT: Runtime> SyncWorker<RT> {
563560 base_version,
564561 } => {
565562 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 )
568565 . await ?;
569566 self . state . modify_identity ( identity, base_version) ?;
570567 self . schedule_update ( ) ;
0 commit comments