Reputation: 653
we have recently added a new feature to our software - preview generation for documents that are uploaded and stored on the server. We did this the following way:
The problem that I am facing now is this - the new code for generating previews uses some of our legacy code and it sometimes "freezes" the Word or Excel processes. The generation of preview stops and all the following previews stay in "pending" mode until I kill the Word, Excel processes (we test the preview for MS Office documents). After I kill the processes, preview generation continues on.
I was thinking of implementing timers into our service so that if a service is awaiting for more that 1 minute after the preview generation has been started, it should kill the process and continue on with generating previews for other documents.
The main problem that I have is that i can not "move" the calls to our legacy code to separate processes as we have done with other documents (for example, we have implemented .ps file generation with GhostScript via Process'es).
Any ideas on how to "processify" the calls to legacy code?
Upvotes: 2
Views: 187
Reputation: 24319
Can you make a second process which is a watchdog on the first process?
Or can you make the first process auto-restart, and have a second timer thread that monitors it and then kills its own process?
Upvotes: 2