mirror of
				https://github.com/zulip/zulip.git
				synced 2025-11-03 21:43:21 +00:00 
			
		
		
		
	upload: Remove common cache from get_export_tarball_url.
This is not called in the hot path like get_avatar_url is.
This commit is contained in:
		
				
					committed by
					
						
						Tim Abbott
					
				
			
			
				
	
			
			
			
						parent
						
							a5bf452202
						
					
				
				
					commit
					4cf835d9dd
				
			@@ -415,8 +415,18 @@ class S3UploadBackend(ZulipUploadBackend):
 | 
			
		||||
 | 
			
		||||
    @override
 | 
			
		||||
    def get_export_tarball_url(self, realm: Realm, export_path: str) -> str:
 | 
			
		||||
        # export_path has a leading /
 | 
			
		||||
        return self.get_public_upload_url(export_path.removeprefix("/"))
 | 
			
		||||
        client = self.avatar_bucket.meta.client
 | 
			
		||||
        signed_url = client.generate_presigned_url(
 | 
			
		||||
            ClientMethod="get_object",
 | 
			
		||||
            Params={
 | 
			
		||||
                "Bucket": self.avatar_bucket.name,
 | 
			
		||||
                # export_path has a leading /
 | 
			
		||||
                "Key": export_path.removeprefix("/"),
 | 
			
		||||
            },
 | 
			
		||||
            ExpiresIn=0,
 | 
			
		||||
        )
 | 
			
		||||
        # Strip off the signing query parameters, since this URL is public
 | 
			
		||||
        return urlsplit(signed_url)._replace(query="").geturl()
 | 
			
		||||
 | 
			
		||||
    @override
 | 
			
		||||
    def upload_export_tarball(
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user