all i need now is db and figure out how to properly run both server and client in background :)
ianmcorvidae
I think we just ran them in screen before
oh
there's a thing to make sure they keep running
lemme grab the one used by reports.mbsandbox
Gentlecat
i'm not a linux guru yet heh
ianmcorvidae
for that I just use: while true; do ./venv/reports/bin/python reports.fcgi & sleep 1200; ps aux | grep reports.fcgi | grep -v grep | awk '{print $2}' | xargs kill; done
which is 100% hack, in a real system we'd deploy either of these with uwsgi
but it works for this :)
obviously change the location of the virtualenv python binary and the name of the .fcgi file
(in both places)
Gentlecat
right
ianmcorvidae
grepping for something including your username is also a good idea since of course mjjc's is still running
his seems to be in tmux rather than screen, but same idea :)
you won't want that, since both things will include 'gentlecat'
so the client one will kill the server and vice versa
I'd have do /home/gentlecat/...venv/bin/python (i.e., use the full path), and then replace 'grep gentlecat' with 'grep client.fcgi | grep gentlecat'
(or server.fcgi, for that one, obviously)
probably could be done with one grep but it doesn't really matter, so :)
Gentlecat
updated pastebin
oh, also full path
ianmcorvidae
yeah
the DB is created, incidentally
seems to still be 500ing, not sure why
oh, I guess I haven't actually done the table-making and such, though you can probably do that
I've done what python manage.py create_db would do, anyway, if somewhat more manually
Gentlecat
okay
ianmcorvidae
the pastebin looks right at this point as well
if you don't know screen: 'screen' creates a new one, then you can run one of them, then "ctrl-a c" will create a second window in which to run the other, ctrl-a n/p to move to next/previous window and ctrl-a d to detach; screen -ls will list current screens and screen -rd will reconnect if there's only one; if there's more than one you'll have to specify a process number or such, which you can get from screen -ls
Gentlecat
that's some cool magic, looks like i've got both server and client running
still getting 500 though
ianmcorvidae
yup, getting errors rather than 502s on both
I assume tables/fixtures still need inserting, anyway, but as mentioned I think you can do that without me, so
huh. project gutenberg URLs auto-detect as "lyrics". I was wondering how that would work. i.e. wondering if one could use "misc" or something for audiobooks.
well, okay, "misc" is deprecated , bad example
ianmcorvidae
Gentlecat: I hadn't changed anything, but good it's working I guess!
Gentlecat
I switched to branch with cover art, should look a bit better now
ianmcorvidae
cool
I see a review on the front page that doesn't seem to exist? I guess the 'Random user' user is fake anyway though
oh, or it just went away and it was my local HTTP cache, heh
Gentlecat
yeah, I just removed one
I guess we need more ways to access review creation and editing stuff
ianmcorvidae
yeah, a prominent 'create review' button or such would be nice (when you aren't over your limits, at least, though probably just disabling it in that case makes sense)
Gentlecat
it's a bit annoying that I need to open /profile/review/ just to edit reviews or add a new one
ianmcorvidae
yeah
the onerror for the images isn't getting fired for me in some cases
Gentlecat
yep, I noticed that too
ianmcorvidae
which may be because you need to do what musicbrainz-server does and not add the src until the onerror is there (i.e., add an empty <img> and then add the src with javascript)
Gentlecat
mostly when tab is in background
can you link me an example?
ianmcorvidae
of what MBS does? the issue is of course transient, it depends on how caches interact mostly
if that's still the onerror callback that won't help, because the issue is the onerror callback not firing
Gentlecat
right, I need to call that for every image
ianmcorvidae
yeah, but if you already have a src set, that's the issue
you need to set the error callback before setting the src at all; it looks like what you're doing there is setting the src to the same thing after setting the error callback
which won't work because the browser won't rerequest the image if it already knows it's missing, and thus won't fire the error callback
Gentlecat
I updated last pastebin
ianmcorvidae
yeah, that looks right
Gentlecat
but that seems kind of hacky
ianmcorvidae
it definitely is hacky, yeah :/ not much to do about it
Gentlecat
I guess we'll have to wait for API fixes
ianmcorvidae
there's other methods of trying to see if an image loaded correctly (img.complete and image.naturalWidth seem to pop up fairly often, but neither is supported everywhere), none that are events quite the way you'd probably want
img error events don't bubble, as I recall, which prevents the potentially-nice option of putting it on <body> or something
another option would be something server-side, I guess, that tries to load the image, and if it works return a redirect to it, otherwise a redirect to the not-found image?
arguably that'd be a good thing to add to caa.org, even, just an extra parameter for something to 307 to in case of a 404, rather than just 404ing
Gentlecat
but wouldn't server side checking increase page load time?