1

I need to run 4 background gobs for cleaning temp files and proccessing some files. I have chosen Quart.net for the job.

I have a Asp.Net website, which accepts uploading files that will be processed by the Quartz Jobs at night.

First i thought about making a console application for the Quartz jobs, keeping the website and the jobs totally decoupled.

But then, i've seen that i will need some config values (connectionstring and paths to files) that are on the asp.net web.config. So a question came to my mind:

Should i run the jobs through the asp.net instance or should i do this on a console application?

Furthermore, i want that when the Quartz jobs start running, the website show a special page (like "We are processing the files...).

What i care the most is the performance, i don't want the website to be affected by the Quartz jobs, neither the jobs' performance affected by the website.

So, what should i do? Have you done something like this and can give me an advice?

1
  • you can create a windows service and let the windows service run the quartz job. while the quartz job is running, you can have a flag stored in a table which says that the quartz job is running and in your asp.net page, just read that flag and display a page that says the Job is running if that flag is true. you can use jquery ajax to check for the flag. Commented Jun 16, 2015 at 18:52

1 Answer 1

1

Should i run the jobs through the asp.net instance or should i do this on a console application?

If you want to have to manually trigger them each night, sure. But a console application using the host system's task scheduler seems like a more automated solution. A web application is more of a request/response system, it's not really suited for periodic or long-running actions. Scheduling some sort of background operation on the host, such as a scheduled console application or a windows service, would serve that purpose better.

Note that if it truly needs to be unattended and run even when there's nobody logged in to the server console, a windows service may be a more ideal approach than a console application.

i've seen that i will need some config values (connectionstring and paths to files) that are on the asp.net web.config

Console application have App.config files which serve the same purpose. You can use that.

i want that when the Quartz jobs start running, the website show a special page

You definitely want to keep the two de-coupled. But you may be able to accomplish this easily enough. Maybe have some sort of status flag in the database which indicates if any particular record is "currently being processed". The website can simply look for any records with that flag when a page loads and display that message.

There are likely a couple of different ways to synchronize status here, it doesn't really matter what you choose. What does matter is that the systems remain decoupled and that any status which is statically persisted is handled somewhat carefully to avoid an errant process from leaving an incorrect status. (For example, a background task sets a status of "processing" and then fails in some way. The website would forever indicate that it's processing.)

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.