// Execute a command right away
Execute a command right away
// Execute a command right away
func Immediate(response http.ResponseWriter, request *http.Request) {
	defer func() {
		err := recover()
		if err != nil {
			HandleError(response, err)
		}
	}()
	account, err := ValidateRequest(response, request)
	if err != nil {
		HandleError(response, err)
	}
	fmt.Println("Immediate Command")
	cmd := GetClientRequest(request)
	command := jobs.NewCommand(cmd)
	job := jobs.NewImmediateJob(account, command)
	err = jobs.Spawn(account, job)
	if err != nil {
		HandleError(response, err)
	} else {
		StreamResponse(job, response)
	}
}
func Immediate ( response http . ResponseWriter , request * http . Request ) { defer func ( ) { err := recover ( ) if err != nil { HandleError ( response , err ) } } ( ) account , err := ValidateRequest ( response , request ) if err != nil { HandleError ( response , err ) } fmt . Println ( " " ) cmd := GetClientRequest ( request ) command := jobs . NewCommand ( cmd ) job := jobs . NewImmediateJob ( account , command ) err = jobs . Spawn ( account , job ) if err != nil { HandleError ( response , err ) } else { StreamResponse ( job , response ) } }
Execute a command right away
Execute a command right away