JsReport Restart
-
Hi again,
We have .NET application we configure Jsreprot in Startup.cs file,
There is possibility to restart Jsreport service after every 12 or 24 hours in running application?
-
You have typically a code like this in the startup something like this
var rs = new LocalReporting() .AsUtility() .Create();
You can add a c# timer that calls this
rs.KillAsync().Wait();
Any reason to restart it periodically?
-
Hey,
Thank you.Actually I already share you some day ago issue about we getting memory usage issue while running multiple batch run on our application pod.
So as per my understanding if we restart Jsreport engine service daily on 12am UTC time if possible so maybe this will solve our issue.
If you have any idea how to use C# timer to restart Jsreport service at 12am UTC using rs.KillAsync().Wait(); ?
-
Actually I already share you some day ago issue about we getting memory usage issue while running multiple batch run on our application pod.
Are you able to replicate this outside of your application? Inside an empty repo with just some little code? I would like to check it. We aren't currently aware of memory leaking problems in the latest.
If you have any idea how to use C# timer to restart Jsreport service at 12am UTC using rs.KillAsync().Wait(); ?
Perhaps something similar to this.. but it's just a copy-paste from the internet.
aTimer = new System.Timers.Timer(60 * 60 * 1000); //one hour in milliseconds aTimer.Elapsed += new ElapsedEventHandler(OnTimedEvent); aTimer.Start(); private static void OnTimedEvent(object source, ElapsedEventArgs e) { if (DateTime.Now.Hour == 23) { rs.KillAsync().Wait(); } }
-
Hey Hi again,
Thank you for solution.
-
Maybe we found our issue for memory usage, we assign storage 1Gb size for 'temp' folder on pod, those temporary files generated by Jsreport not cleaning, taking much time to cleanup and also taking up to 1.5GB storage on my machine for generate 600 report.
Can you please suggest how to implement below code in .Net (C#), So we can clean files rapidly, we don't get any implementation and related search for Cleanup Extensions.Reports in latest Jsreport version.
{
"extensions": {
"reports": {
// how often the cleanup runs
"cleanInterval": "5m",
// how much old reports should be deleted
"cleanThreshold": "1d",
// how many deletes are processed in parallel (this avoids putting too much pressure on the database), defaults to 10
"cleanParallelLimit": 10
}
}
}
-
This post is deleted!
-
@jan_blaha Hey Hi Jan,
We need Immediate ASAP solution. we have deadline, can you please help us for this issue?
-
The temp files are created in the folder
autocleanup
and cleaned every 30s.
In this interval, files that are older than 3minutes are cleaned unless you configurereportTimeout
to higher value.
In case you need to use a more proactive approach to clean temp, you can deleteautocleanup
files in c#.So we can clean files rapidly, we don't get any implementation and related search for Cleanup Extensions.Reports in latest Jsreport version.
Do you actually use the reports extension and persist reports? Its not very common and you may not need to deal with the mentioned configs.
https://jsreport.net/learn/reports