MCPcopy Create free account
hub / github.com/actiontech/dtle / Shutdown

Method Shutdown

driver/oracle/extractor/extractor_oracle.go:352–377  ·  view source on GitHub ↗

Shutdown is used to tear down the ExtractorOracle

()

Source from the content-addressed store, hash-verified

350
351// Shutdown is used to tear down the ExtractorOracle
352func (e *ExtractorOracle) Shutdown() error {
353 e.logger.Debug("ExtractorOracle shutdown")
354 e.shutdownLock.Lock()
355 defer e.shutdownLock.Unlock()
356
357 if e.shutdown {
358 return nil
359 }
360 e.logger.Info("ExtractorOracle shutdown")
361
362 e.shutdown = true
363 close(e.shutdownCh)
364
365 if e.natsConn != nil {
366 e.natsConn.Close()
367 }
368
369 if err := e.oracleDB.Close(); err != nil {
370 e.logger.Error("Shutdown error close oracleDB.", "err", err)
371 }
372
373 e.wg.Wait()
374
375 e.logger.Info("Shutting down")
376 return nil
377}
378
379func (e *ExtractorOracle) Finish1() (err error) {
380 // TODO shutdown job on error

Callers 1

onErrorMethod · 0.95

Calls 1

CloseMethod · 0.45

Tested by

no test coverage detected