mirror of https://github.com/zulip/zulip.git
22837fc1b4
Rather than pass around a list of message objects in-memory, we instead keep the same constructed QuerySet which includes the later propagated messages (if any), and use that same query to pick out affected Attachment objects, rather than limiting to the set of ids. This is not necessarily a win -- the list of message-ids *may* be very long, and thus the query may be more concise, easier to send to PostgreSQL, and faster for PostgreSQL to parse. However, the list of ids is almost certainly better-indexed. After processing the move, the QuerySet must be re-defined as a search of ids (and possibly a very long list of such), since there is no other way which is guaranteed to correctly single out the moved messages. At this point, it is mostly equivalent to the list of Message objects, and certainly takes no less memory. |
||
---|---|---|
.. | ||
actions | ||
data_import | ||
integration_fixtures/nagios | ||
lib | ||
management | ||
migrations | ||
models | ||
openapi | ||
tests | ||
tornado | ||
transaction_tests | ||
views | ||
webhooks | ||
worker | ||
__init__.py | ||
apps.py | ||
context_processors.py | ||
decorator.py | ||
filters.py | ||
forms.py | ||
logging_handlers.py | ||
middleware.py | ||
signals.py |