Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cache codecogs equation rendering to avoid timeout errors #15

Open
apjanke opened this issue Sep 17, 2021 · 0 comments
Open

Cache codecogs equation rendering to avoid timeout errors #15

apjanke opened this issue Sep 17, 2021 · 0 comments
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@apjanke
Copy link
Member

apjanke commented Sep 17, 2021

About half the time I run make docs, it errors out due to a timeout on a codecogs web service query.

>> mlxshake_make docs
Exporting: MlxShake doc file: Tutorial.mlx
Exporting: /Users/janke/local/repos/MlxShake/docs-src/Tutorial.mlx -> /private/var/folders/_4/9mx5ryp52bb_z6drbcbrhwl40000gn/T/tpd7f7c402_3583_42c8_a38d_92d44747d285/Tutorial.tex
Exported:  /Users/janke/local/repos/MlxShake/docs-src/Tutorial.mlx -> /private/var/folders/_4/9mx5ryp52bb_z6drbcbrhwl40000gn/T/tpd7f7c402_3583_42c8_a38d_92d44747d285/Tutorial.tex
Exporting: /private/var/folders/_4/9mx5ryp52bb_z6drbcbrhwl40000gn/T/tpd7f7c402_3583_42c8_a38d_92d44747d285/Tutorial.tex -> /Users/janke/local/repos/MlxShake/docs/Tutorial.md
Error using websave (line 98)
The connection to URL
'https://latex.codecogs.com/gif.latex?%5Cbegin%7Barray%7D%7Bl%7D&space%3B%5Csin&space%3Bx=-%5Cint&space%3B%5Ccos&space%3Bxdx%5C%5C&space%3B%5Ccos&space%3Bx=%5Cint&space%3B%5Csin&space%3Bxdx&space%3B%5Cend%7Barray%7D' timed out
after 5.000 seconds. The reason is "Resolving timed out after 5103 milliseconds". Perhaps the server is not responding or weboptions.Timeout needs to be set to a higher value.
Error in janklab.mlxshake.internal.LsLatex2MardkownExporter>grabCodecogsEquationImage (line 538)
websave(file, codecogsUrl);
Error in janklab.mlxshake.internal.LsLatex2MardkownExporter>saveCodecogsRender (line 522)
grabCodecogsEquationImage(equationCode, file);
Error in janklab.mlxshake.internal.LsLatex2MardkownExporter>processEquations (line 489)
                [mdImgTag, eqnum] = saveCodecogsRender(eqncode, outImagesRelDir, outImagesDir, eqnum);
Error in janklab.mlxshake.internal.LsLatex2MardkownExporter/lslatex2markdown (line 154)
            str2md = processEquations(str2md, opts, inImagesRelDir, inImagesDir);
Error in janklab.mlxshake.lslatex2markdown (line 34)
outMdFile = exporter.lslatex2markdown(inFile, opts);
Error in janklab.mlxshake.exportlivescript (line 157)
            mdFile = janklab.mlxshake.lslatex2markdown(texFile, opts2);
Error in mlxshake_gendocs (line 42)
        janklab.mlxshake.exportlivescript(mlxFile, {'outFile', mdFile});
Error in mlxshake_make>build_docs (line 110)
mlxshake_gendocs(parts);
Error in mlxshake_make (line 40)
  build_docs(varargin) 
>> 

Mabye cache the codecogs results (safely) so this doesn't happen so often.

@apjanke apjanke self-assigned this Sep 17, 2021
@apjanke apjanke added the enhancement New feature or request label Sep 17, 2021
@apjanke apjanke added this to the 1.0.0 milestone Sep 17, 2021
@apjanke apjanke changed the title Cache codecogs equation rendering Cache codecogs equation rendering to avoid timeout errors Sep 17, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant