package main

import (
	"os"
	"time"

	"git.wecise.com/wecise/odb-go/odbc"
	"git.wecise.com/wecise/odbtools/datasync/datasync"
)

var mcfg, logger = odbc.SetDefaultAppName("datasync")

func main() {
	println("cat", logger.FileOutPath(), "for detail information")
	odbtools := datasync.NewDataSync()
	e := odbtools.Init()
	if e != nil {
		logger.Error(e)
		os.Exit(1)
		return
	}
	done := odbtools.Run()
	if done == nil {
		os.Exit(0)
		return
	}
	e = <-done
	if e != nil {
		logger.Error(e)
		os.Exit(1)
		return
	}
	time.Sleep(500 * time.Millisecond)
}
