Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Feature: Implement purge_media_cache admin API #902

Merged
merged 3 commits into from
Jun 29, 2016

Conversation

erikjohnston
Copy link
Member

@erikjohnston erikjohnston commented Jun 29, 2016

Adds an API to purge old remote media that has been locally cached. API:

POST /_matrix/client/api/v1/admin/purge_media_cache?access_token=X&before_ts=1467208470882

200 OK
{
    "deleted": 5
}

This purges all cached remote media that was last accessed before the time given by before_ts.

The requester must be a server admin.

@erikjohnston erikjohnston changed the title Implement purge_media_cache admin API Feature: Implement purge_media_cache admin API Jun 29, 2016

yield self.store.delete_remote_media(origin, media_id)
try:
os.removedirs(thumbnail_dir)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, will this race with adding an item under a different key?

@NegativeMjark
Copy link
Contributor

LGTM

@erikjohnston erikjohnston merged commit aac546c into develop Jun 29, 2016
@richvdh richvdh deleted the erikj/expire_media branch December 1, 2016 14:09
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants