mirror of
https://github.com/sensebox/blockly-app
synced 2025-04-18 23:07:32 +02:00
increase compiler timeout to 30sec
needed when including SenseboxMCU.h
This commit is contained in:
parent
3faea789cb
commit
24e18b7a3d
1 changed files with 6 additions and 3 deletions
|
@ -13,15 +13,18 @@ export class CompilerProvider {
|
||||||
}
|
}
|
||||||
|
|
||||||
async callcompiler(sketch : string): Promise<ArrayBuffer> {
|
async callcompiler(sketch : string): Promise<ArrayBuffer> {
|
||||||
const headers = new HttpHeaders({'Content-Type': 'application/json'} );
|
const headers = new HttpHeaders({'Content-Type': 'application/json'} );
|
||||||
const data = { board: 'sensebox-mcu', sketch }
|
const data = { board: 'sensebox-mcu', sketch }
|
||||||
|
|
||||||
// send compilation request, returning a job ID
|
// send compilation request, returning a job ID
|
||||||
return this.http.post(`${URL}/compile`, data, { headers })
|
return this.http.post(`${URL}/compile`, data, { headers })
|
||||||
.pipe(timeout(4000))
|
.pipe(timeout(30000))
|
||||||
.toPromise()
|
.toPromise()
|
||||||
.catch(err => {
|
.catch(err => {
|
||||||
let msg = 'unable to contact web compiler. are you online?'
|
let msg = err.message
|
||||||
|
if (err.name === 'TimeoutError')
|
||||||
|
msg = 'unable to contact web compiler. are you online?'
|
||||||
|
|
||||||
try {
|
try {
|
||||||
// attempt to extract the compilation error message and clean it up
|
// attempt to extract the compilation error message and clean it up
|
||||||
msg = JSON.parse(err.error.message).process
|
msg = JSON.parse(err.error.message).process
|
||||||
|
|
Loading…
Add table
Reference in a new issue