X-Git-Url: http://gitweb.michael.orlitzky.com/?a=blobdiff_plain;f=src%2FMain.hs;h=ed28f919b7e349e782b8e62e4cacc7f2ecfa120c;hb=000318e2a4b56772a9ef219a13e960acea6453b6;hp=e8c1356b6dd40234046b9f8f44be4188f8f6c4b4;hpb=a53f1a77e6d24d8a4771be4dd365f2738c50bf6f;p=dead%2Fhtsn-import.git diff --git a/src/Main.hs b/src/Main.hs index e8c1356..ed28f91 100644 --- a/src/Main.hs +++ b/src/Main.hs @@ -45,8 +45,8 @@ import TSN.DbImport ( DbImport(..), ImportResult(..) ) import qualified TSN.XML.Heartbeat as Heartbeat ( verify ) import qualified TSN.XML.Injuries as Injuries ( Listing ) import qualified TSN.XML.InjuriesDetail as InjuriesDetail ( PlayerListing ) -import qualified TSN.XML.News as News ( Message ) -import qualified TSN.XML.Odds as Odds ( Message ) +import qualified TSN.XML.News as News ( News ) +import qualified TSN.XML.Odds as Odds ( Odds ) import Xml ( DtdName(..), parse_opts ) @@ -153,7 +153,7 @@ import_file cfg path = do dbimport (undefined :: InjuriesDetail.PlayerListing) | dtd == "newsxml.dtd" = - dbimport (undefined :: News.Message) + dbimport (undefined :: News.News) | dtd == "Odds_XML.dtd" = undefined @@ -183,7 +183,7 @@ main = do -- logging before the missing parameter checks below so that we can -- log the errors. let cfg = (def :: Configuration) `merge_optional` opt_config - init_logging (log_file cfg) (log_level cfg) (syslog cfg) + init_logging (log_level cfg) (log_file cfg) (syslog cfg) -- Check the optional config for missing required options. when (null $ OC.xml_files opt_config) $ do @@ -211,7 +211,7 @@ main = do report_info $ "Removed processed file " ++ path ++ "." -- | Try to remove @path@ and potentially try again. - kill try_again path = do + kill try_again path = (remove_and_report path) `catchIOError` exception_handler where -- | A wrapper around threadDelay which takes seconds instead of @@ -228,7 +228,7 @@ main = do report_error (show e) report_error $ "Failed to remove imported file " ++ path ++ "." if try_again then do - report_info $ "Waiting 5 seconds to attempt removal again..." + report_info "Waiting 5 seconds to attempt removal again..." thread_sleep 5 kill False path else