source: trunk/grails-app/controllers/nl/tno/massSequencing/worker/WorkerController.groovy @ 70

Last change on this file since 70 was 70, checked in by robert@…, 8 years ago
  • Installed templates (in order to extend session lifetime to 2 hours)
  • Implemented background worker to do work outside the HTTP request
File size: 719 bytes
Line 
1package nl.tno.massSequencing.worker
2
3import grails.converters.*;
4
5class WorkerController {
6
7        /**
8         * Runs the given process by showing a waiting screen that calls the specific urls
9         */
10        def process = {
11                def processId = params.processId;
12               
13                if( !processId ) {
14                        flash.error = "No process ID given to start process.";
15                        redirect( controller: "run" );
16                        return;
17                }
18                       
19                render( view: 'process', model: session.process[ processId ].worker );
20        }
21               
22        def getProgress = {
23                def processId = params.processId;
24                if( !processId || !session.progress?.getAt( processId ) ) {
25                        response.setStatus( 500, "No progress information found" );
26                        render ""
27                        return
28                }
29               
30                render session.progress[ processId ] as JSON
31        }
32
33}
Note: See TracBrowser for help on using the repository browser.