diff --git a/backend/api/exercices/views.py b/backend/api/exercices/views.py index 6f2b934e..2724e12e 100644 --- a/backend/api/exercices/views.py +++ b/backend/api/exercices/views.py @@ -419,14 +419,11 @@ def pdfGen(request): template = get_template('test.tex') latex = template.render(context) - print('LATEX', latex) with tempfile.TemporaryDirectory() as tempdir: direct = tempdir with open(os.path.join(direct, 'tmp.tex'), 'x', encoding='utf-8') as f: f.write(latex) - - with open(os.path.join(direct, 'tmp.tex'), 'r', encoding='utf-8') as f: - print('FILE', f.read()) + command = f'xelatex -interaction=batchmode tmp.tex' try: subprocess.run(command, shell=True, diff --git a/frontend/context/websocket.context.js b/frontend/context/websocket.context.js index a32cff88..f4fc9bc5 100644 --- a/frontend/context/websocket.context.js +++ b/frontend/context/websocket.context.js @@ -13,14 +13,12 @@ export const WebsocketProvider = ({ children }) => { const [isConnected, setConnected] = useState(false); const router = useRouter(); const connect = (url) => { - if (isBrowser) { + if (isBrowser) { var url = url.startsWith('/')? url: '/' + url - console.log( - `ws://${process.env.NEXT_PUBLIC_HOSTNAME}:${process.env.NEXT_PUBLIC_PORT}${url}` - ); + ws.current = new ReconnectingWebSocket( - `ws://${process.env.NEXT_PUBLIC_HOSTNAME}:${process.env.NEXT_PUBLIC_PORT}${url}` + `ws://${process.env.NEXT_PUBLIC_HOST}${url}` ); ws.current.onopen = () => {