Topic on Extension talk:Scribunto

Mediawiki Scribunto edit page timeout

4
88.134.41.99 (talkcontribs)

So, I have a Scribunto Module page named Module:X. Since I have a lot of functions I simply put everything on one page and accordingly the page is very long.

Yesterday I made some changes and added some code. I clicked on "Publish changes" and then, first the website froze and after a while, I got a 504 Gateway Time-out.

I tried changing the code in hopes of finding the problem and I think it has to do with its length. First I saw that the Error only occurred when the page was longer than 2100 lines. But then I deleted all comments and unnecessary linebreaks and the error occurred at around 1900 lines.

Has anyone experienced a similar problem or has an idea where it could come from?

Dinoguy1000 (talkcontribs)

So, I have a Scribunto Module page named Module:X. Since I have a lot of functions I simply put everything on one page and accordingly the page is very long.

Module:X sounds like it's doing way too much; in particular, you've made it sound like the module is responsible for completely unrelated features. Your first step here is going to be to refactor it into separate modules with logical responsibilities (for example, on Wikipedia, Module:Navbox is responsible for creating navboxes, while Module:Infobox is responsible for creating infoboxes). No one is going to be able to help you diagnose and correct any errors until you've done this (especially errors as vague as "I get a 504 Gateway Time-out if I have more than 1234 lines of code). You may find that the error goes away in the course of refactoring, too.

88.134.41.99 (talkcontribs)

Thanks, i already turned the module into 2 parts, importing each other. The problem is, that they are in fact not completely unrelated features, but functions, that are referenced by a lot of other functions. I know that keeping you're code clean by splicing it into different parts is important, but i didn't want it to be seperated because of all the cross-referencing. I will try to make as much topic-seperated Modules as possible, but as I said, it is basically one thing. But thanks anyway, if someone finds a soluton, regardless of me having avoided the problem, I would be still gratefull for it.

Dinoguy1000 (talkcontribs)

I'd welcome someone proving me wrong, but in general I don't think there's much that can be said about your situation without actually seeing your code. Without that, the most you're likely to get is vague general advice that may or may not actually apply to the specifics of your situation.

Reply to "Mediawiki Scribunto edit page timeout"