diff --git a/devdocs/deploy.txt b/devdocs/deploy.txt index 7b41ffc2..c6d6d343 100644 --- a/devdocs/deploy.txt +++ b/devdocs/deploy.txt @@ -243,7 +243,6 @@ IMPORTANT NOTES: DOCKER / LINUX CHEAT SHEET Alpine linux enter container and run shell from docker: - docker run -it [container_id] /bin/ash - + sudo docker exec -it xfer_ayanova_1 ash diff --git a/server/AyaNova/biz/ReportBiz.cs b/server/AyaNova/biz/ReportBiz.cs index b7782dde..19df61fe 100644 --- a/server/AyaNova/biz/ReportBiz.cs +++ b/server/AyaNova/biz/ReportBiz.cs @@ -371,7 +371,7 @@ namespace AyaNova.Biz { log.LogDebug($"Not Windows: setting executable path for chrome to expected '/usr/bin/chromium-browser'"); lo.ExecutablePath = "/usr/bin/chromium-browser";//this is the default path for docker based alpine dist, but maybe not others, need to make a config setting likely - // lo.Args = new string[] { "--no-sandbox" }; + // lo.Args = new string[] { "--no-sandbox" }; /* https://github.com/puppeteer/puppeteer/issues/1825 const chromeFlags = [ @@ -382,7 +382,7 @@ namespace AyaNova.Biz "--no-zygote" ] */ - lo.Args = new string[] { "--headless --no-sandbox --disable-gpu --single-process --no-zygote" }; + lo.Args = new string[] { "--headless --no-sandbox --disable-gpu --single-process --no-zygote" }; } else { @@ -394,7 +394,7 @@ namespace AyaNova.Biz //https://stackoverflow.com/questions/53367966/puppeteer-sharp-still-appear-many-chromium-instance-in-process-task-manager-when log.LogDebug($"Launching headless Chrome now:"); using (var browser = await Puppeteer.LaunchAsync(lo)) - + using (var page = await browser.NewPageAsync()) { try @@ -519,10 +519,15 @@ namespace AyaNova.Biz //render to pdf and return log.LogDebug($"Calling render page contents to PDF"); await page.PdfAsync(outputFullPath); + + //close the browser + // log.LogDebug($"Closing browser"); + // await browser.CloseAsync(); + log.LogDebug($"Completed, returning results"); return outputFileName; } - catch + catch { //NOTE: in future may need to kill the chromium process if it's found to be hanging around //my preliminary thinking is to keep track of the browser.process.processid above and check if still present and zap if so @@ -536,6 +541,10 @@ namespace AyaNova.Biz // var v=await page.GetContentAsync(); throw; } + finally + { + await browser.CloseAsync(); + } } } diff --git a/server/AyaNova/util/AyaNovaVersion.cs b/server/AyaNova/util/AyaNovaVersion.cs index 67ec5a00..2ffa7f2f 100644 --- a/server/AyaNova/util/AyaNovaVersion.cs +++ b/server/AyaNova/util/AyaNovaVersion.cs @@ -5,7 +5,7 @@ namespace AyaNova.Util /// internal static class AyaNovaVersion { - public const string VersionString = "8.0.0-alpha.17"; + public const string VersionString = "8.0.0-alpha.18"; public const string FullNameAndVersion = "AyaNova server " + VersionString; }//eoc }//eons \ No newline at end of file