Loading operational +6 −3 Original line number Diff line number Diff line Loading @@ -492,9 +492,6 @@ via env var and command line parameter. * current :entry: ** ** 2024-04-07 when combining blocks to create final file, don't print "No block fetched in last 10 seconds" log any more if there is no other files in DL list. ** 2024-04-07 rd-api: when a file content is changed on disk, auto invalidate all cached blocks. Loading Loading @@ -537,6 +534,12 @@ policy in ovs can do it. see stretch01 daylog. * done :entry: ** 2024-04-25 haskell: when only executable code changes, should I in increase version in package.yaml I think I will defer version change to avoid re-compilation of the base library. ** 2024-04-07 when combining blocks to create final file, don't print "No block fetched in last 10 seconds" log any more if there is no other files in DL list. ** 2024-04-24 try build this project in gocd. - build in debian stretch agent node. - build in docker is fine. Loading package.yaml +2 −0 Original line number Diff line number Diff line name: reliable-download # do not modify version if lib/ code is not changed. # real app version: 1.2.7.0 version: 1.2.6.0 synopsis: provide reliable download service via HTTP description: reliable-download web application and cli tool Loading pypi/rd-client/README.rst +4 −0 Original line number Diff line number Diff line Loading @@ -72,6 +72,10 @@ https://gitlab.emacsos.com/sylecn/reliable-download ChangeLog --------- * dev - bugfix: don't print no block fetched in last N seconds when all blocks are fetched. * v1.5.0.0 2024-04-08 - bugfix: properly handle unicode string in URL path Loading rd/RD/Client/Progress.hs +16 −7 Original line number Diff line number Diff line Loading @@ -82,22 +82,31 @@ showProgressAllDone rc = do ("All urls downloaded. " % int % " files, " % int % " blocks.") totalfilec totalblockc -- | show progress if at least one new block is fetched since last time. Otherwise, give a hint there may be a DL hang. -- | show progress if at least one new block is fetched since last -- time. Otherwise, give a hint there may be a DL hang. when all blocks are -- fetched, return -1 showProgressMaybe :: RDClientRuntimeConfig -> Int -> IO Int showProgressMaybe rc lastDownloadedBlockCount = do p <- readMVar (rdProgress rc) let newDLBC = piDownloadedBlockCount p if newDLBC > lastDownloadedBlockCount then do if newDLBC > lastDownloadedBlockCount then do showProgress1 rc p return newDLBC else do else if piDownloadedBlockCount p < piTotalBlockCount p then do warnl rc $ sformat ("No block fetched in last " % int % " seconds") (progressInterval (rdOptions rc)) return lastDownloadedBlockCount else return (-1) -- | show download progress in console. designed to run in a thread. showProgressLoop :: RDClientRuntimeConfig -> Int -> IO () showProgressLoop rc lastDownloadedBlockCount = do threadDelay (progressInterval (rdOptions rc) * 1000000) newCount <- showProgressMaybe rc lastDownloadedBlockCount showProgressLoop rc newCount case newCount of -1 -> return () _ -> showProgressLoop rc newCount Loading
operational +6 −3 Original line number Diff line number Diff line Loading @@ -492,9 +492,6 @@ via env var and command line parameter. * current :entry: ** ** 2024-04-07 when combining blocks to create final file, don't print "No block fetched in last 10 seconds" log any more if there is no other files in DL list. ** 2024-04-07 rd-api: when a file content is changed on disk, auto invalidate all cached blocks. Loading Loading @@ -537,6 +534,12 @@ policy in ovs can do it. see stretch01 daylog. * done :entry: ** 2024-04-25 haskell: when only executable code changes, should I in increase version in package.yaml I think I will defer version change to avoid re-compilation of the base library. ** 2024-04-07 when combining blocks to create final file, don't print "No block fetched in last 10 seconds" log any more if there is no other files in DL list. ** 2024-04-24 try build this project in gocd. - build in debian stretch agent node. - build in docker is fine. Loading
package.yaml +2 −0 Original line number Diff line number Diff line name: reliable-download # do not modify version if lib/ code is not changed. # real app version: 1.2.7.0 version: 1.2.6.0 synopsis: provide reliable download service via HTTP description: reliable-download web application and cli tool Loading
pypi/rd-client/README.rst +4 −0 Original line number Diff line number Diff line Loading @@ -72,6 +72,10 @@ https://gitlab.emacsos.com/sylecn/reliable-download ChangeLog --------- * dev - bugfix: don't print no block fetched in last N seconds when all blocks are fetched. * v1.5.0.0 2024-04-08 - bugfix: properly handle unicode string in URL path Loading
rd/RD/Client/Progress.hs +16 −7 Original line number Diff line number Diff line Loading @@ -82,22 +82,31 @@ showProgressAllDone rc = do ("All urls downloaded. " % int % " files, " % int % " blocks.") totalfilec totalblockc -- | show progress if at least one new block is fetched since last time. Otherwise, give a hint there may be a DL hang. -- | show progress if at least one new block is fetched since last -- time. Otherwise, give a hint there may be a DL hang. when all blocks are -- fetched, return -1 showProgressMaybe :: RDClientRuntimeConfig -> Int -> IO Int showProgressMaybe rc lastDownloadedBlockCount = do p <- readMVar (rdProgress rc) let newDLBC = piDownloadedBlockCount p if newDLBC > lastDownloadedBlockCount then do if newDLBC > lastDownloadedBlockCount then do showProgress1 rc p return newDLBC else do else if piDownloadedBlockCount p < piTotalBlockCount p then do warnl rc $ sformat ("No block fetched in last " % int % " seconds") (progressInterval (rdOptions rc)) return lastDownloadedBlockCount else return (-1) -- | show download progress in console. designed to run in a thread. showProgressLoop :: RDClientRuntimeConfig -> Int -> IO () showProgressLoop rc lastDownloadedBlockCount = do threadDelay (progressInterval (rdOptions rc) * 1000000) newCount <- showProgressMaybe rc lastDownloadedBlockCount showProgressLoop rc newCount case newCount of -1 -> return () _ -> showProgressLoop rc newCount