This commit is contained in:
anoadragon453 2024-03-14 13:55:07 +00:00
parent ec221f2ad2
commit 051cad208c
4 changed files with 14 additions and 2 deletions

View file

@ -16222,6 +16222,12 @@ WHERE room_stats_state.room_id = event_json.room_id" | psql -d synapse -h l
FROM devices FROM devices
WHERE last_seen < DATE_PART('epoch', NOW() - INTERVAL '3 month') * 1000; WHERE last_seen < DATE_PART('epoch', NOW() - INTERVAL '3 month') * 1000;
</code></pre> </code></pre>
<h2 id="clear-the-cache-of-a-remote-users-device-list"><a class="header" href="#clear-the-cache-of-a-remote-users-device-list">Clear the cache of a remote user's device list</a></h2>
<p>Forces the resync of a remote user's device list - if you have somehow cached a bad state, and the remote server is
will not send out a device list update.</p>
<pre><code class="language-sql">INSERT INTO device_lists_remote_resync
VALUES ('USER_ID', (EXTRACT(epoch FROM NOW()) * 1000)::BIGINT);
</code></pre>
<div style="break-before: page; page-break-before: always;"></div><p><em>This <a href="https://jacksonchen666.com/posts/2022-12-03/14-33-00/">blog post by Jackson Chen</a> (Dec 2022) explains how to use many of the tools listed on this page. There is also an <a href="https://levans.fr/shrink-synapse-database.html">earlier blog by Victor Berger</a> (June 2020), though this may be outdated in places.</em></p> <div style="break-before: page; page-break-before: always;"></div><p><em>This <a href="https://jacksonchen666.com/posts/2022-12-03/14-33-00/">blog post by Jackson Chen</a> (Dec 2022) explains how to use many of the tools listed on this page. There is also an <a href="https://levans.fr/shrink-synapse-database.html">earlier blog by Victor Berger</a> (June 2020), though this may be outdated in places.</em></p>
<h1 id="list-of-useful-tools-and-scripts-for-maintenance-synapse-database"><a class="header" href="#list-of-useful-tools-and-scripts-for-maintenance-synapse-database">List of useful tools and scripts for maintenance Synapse database:</a></h1> <h1 id="list-of-useful-tools-and-scripts-for-maintenance-synapse-database"><a class="header" href="#list-of-useful-tools-and-scripts-for-maintenance-synapse-database">List of useful tools and scripts for maintenance Synapse database:</a></h1>
<h2 id="purge-remote-media-api-1"><a class="header" href="#purge-remote-media-api-1"><a href="usage/administration/../../admin_api/media_admin_api.html#purge-remote-media-api">Purge Remote Media API</a></a></h2> <h2 id="purge-remote-media-api-1"><a class="header" href="#purge-remote-media-api-1"><a href="usage/administration/../../admin_api/media_admin_api.html#purge-remote-media-api">Purge Remote Media API</a></a></h2>

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -328,6 +328,12 @@ WHERE room_stats_state.room_id = event_json.room_id&quot; | psql -d synapse -h l
<pre><code class="language-sql">SELECT user_id, device_id, user_agent, TO_TIMESTAMP(last_seen / 1000) AS &quot;last_seen&quot; <pre><code class="language-sql">SELECT user_id, device_id, user_agent, TO_TIMESTAMP(last_seen / 1000) AS &quot;last_seen&quot;
FROM devices FROM devices
WHERE last_seen &lt; DATE_PART('epoch', NOW() - INTERVAL '3 month') * 1000; WHERE last_seen &lt; DATE_PART('epoch', NOW() - INTERVAL '3 month') * 1000;
</code></pre>
<h2 id="clear-the-cache-of-a-remote-users-device-list"><a class="header" href="#clear-the-cache-of-a-remote-users-device-list">Clear the cache of a remote user's device list</a></h2>
<p>Forces the resync of a remote user's device list - if you have somehow cached a bad state, and the remote server is
will not send out a device list update.</p>
<pre><code class="language-sql">INSERT INTO device_lists_remote_resync
VALUES ('USER_ID', (EXTRACT(epoch FROM NOW()) * 1000)::BIGINT);
</code></pre> </code></pre>
</main> </main>