Skip to content

Libreoffice Concurrence #94

Description

@jrios2006

Hello I have a doubt about a libreoffice concurrence when I try to convert an office documento to pdf.

In my linux computer when I try to execute the conversion program I run this comand
libreoffice --headless --convert-to pdf filename.doc

If this program may take 40 seconds to run for example, then in this time if there is another request to execute another conversion like that
libreoffice --headless --convert-to pdf anotherfilename.doc

The second request executes but the results is bad (fails to generate the pdf) becuase the libreoffice fails.

Is it possible add to the program that before execuntig the conversion, the program asks if libreoffice is executing and if that ocurrs the program wait to execute another conversion?

For example:

def CheckExecuteLibreOffice():

'''
Function to know if Libreoffice is executing for example
ps -aux | grep soffice | wc -l
this return 1 or >1
if $(ps -aux | grep soffice | wc -l) > 1 then
Aux = True
else
Aux = False
end of if
return Aux
'''

.... Process the data

Variable = CheckExecuteLibreOffice()
While Variable is true:
wait 1 second
Variable = CheckExecuteLibreOffice()
end of while
/* In this moment LibreOffice is not executing */
Execute conversion tool

..... Continue the process

Another question, in your program exists a variable that to wait the execute (waitDelay). this works well to say that the convesion takes this seconds.
I think that the code could repeat the process and adds +5 seconds if the result fails and generate and Error 500?

For example

contador = 1
result = convertpdf() ' convertir the office doc
while result is Error or contador <= 10:
waitDelay = waitDelay + 5
contador = contador + 1
Repeat a new process with the same command with the new waitDelay variable
end of while

Best regards,

``

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions