Skip to content

Commit

Permalink
Merge branch 'fix/noop-export' into develop
Browse files Browse the repository at this point in the history
[SVCS-678]
Closes: #334
  • Loading branch information
cslzchen committed May 4, 2018
2 parents 681a0ce + 072c3e0 commit 792d7b6
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions mfr/server/handlers/export.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,13 @@ async def prepare(self):
async def get(self):
"""Export a file to the format specified via the associated extension library"""

# File is already in the requested format
if self.metadata.ext.lower() == ".{}".format(self.format.lower()):
await self.write_stream(await self.provider.download())
logger.info('Exported {} with no conversion.'.format(self.format))
self.metrics.add('export.conversion', 'noop')
return

if settings.CACHE_ENABLED:
try:
cached_stream = await self.cache_provider.download(self.cache_file_path)
Expand Down

0 comments on commit 792d7b6

Please sign in to comment.