We now write the fact that a message was created or updated to a log
table and actually update the tsvector asynchronously from a worker
process.
This also means that when running locally, one now needs to run the
process_fts_updates script in order to have new messages indexed for
full text search.
(imported from commit ebb11b08d30be2a45242dafe146e8e861a0f050a)
Unlike the other workers, this process runs on the database server.
To prevent duplicate work, only the worker on the master actually
processes updates.
To deploy, we in theory just need to apply the new puppet config. In
practice, the database servers aren't on wheezy yet, so the changes
should be applied by hand to postgres0 and postgres1. This only
needs to be done on deploy to staging.
(imported from commit d679ffc0838f9fc8c7f0bede08a5568b339b7ddb)
Previously, when the first `which` failed, the entire script would
fail with exist status 1 because we pass `-e` to the interpreter.
(imported from commit 601de3b3e3edd90110fc478f7874e644009d1b62)
Previously, we would return a JSONDecodeError to the user in the event
that the server returned a 500 error (or other non-JSON content).
(imported from commit 1624dfec6ac65d34216f4de91e33116a54e414fa)
The documentation for the Python `random` module explains that it "is
completely unsuitable for cryptographic purposes." This new way of
generating API keys replaces use of the random module with
`os.urandom()`, which is intended to be suitable for such uses. As a
bonus, the code is simpler and clearer.
(imported from commit cc3697a5048f2da53f0fce6689167f9d1cbb6466)
In a few cases the $.each was doing something imperatively that was
terser and easier to understand by using a different Underscore method,
so a few of these I rewrote.
Some code was using the fact that jQuery sets `this` in the callback to
be the item; I rewrote those to use an explicit parameter.
Some code was using $(some selector).each(callback). I converted these
to _.each($(some selector), callback).
One function, ui.process_condensing, was written to be a jQuery $.each
callback despite being in a totally different module from code using it.
I noticed this and updated the function's args.
(imported from commit bf5922a35f257c168cc09ec1d077415d6ef19a03)
Extract some local variables to set up the next refactoring, where
we can parameterize the function.
(imported from commit 1c2801131c19a54713a0d5c2cc26c419412339b0)
The option caused some race conditions on Firefox, and it is
really made moot by the naturalSearch option anyway.
(imported from commit dc7080c905ced9b2f4ad4275d82549acf09a59f7)
As Kevin points out, un_narrow() itself calls casper.then() so should be
called outside of a callback, not inside one.
(imported from commit c5f02a14c750045697558aeafb070227e3a9d24c)
This covers most of the module's functionality, with special
emphasis on lines that use underscore.js (_.each and _.filter).
(imported from commit 074181a0273286a258504be634bdd1cead2eecd5)