SyncService constructor

SyncService(
  1. ISyncConnectivityService _connectivityService,
  2. ILoggerProvider _syncLogger,
  3. ISyncErrorManager _errorManager,
  4. ISyncErrorReporter _errorReporter,
)

Gerencia todo o ciclo de vida da sincronização de dados, incluindo operações automáticas em background, tratamento de falhas, modo offline e recuperação de erros.

Implementation

SyncService(
  this._connectivityService,
  this._syncLogger,
  this._errorManager,
  this._errorReporter,
) {
  _downloadStrategy = SyncDownloadStrategy();

  _uploadStrategy = SyncUploadStrategy(
    _syncLogger,
    _errorManager,
  );

  SyncUtils.debugLog(
      'SyncService inicializado - syncInterval: ${SyncConstants.syncInterval.inSeconds}s, initialDelay: ${SyncConstants.initialSyncDelay.inSeconds}s, recoveryTimeout: ${SyncConstants.recoveryTimeout.inSeconds}s',
      tag: 'SyncService');

  _initConnectivityListener();
  _checkInitialConnectivity();
}