We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 1dd5461 + 4f4c919 commit 3e55b90Copy full SHA for 3e55b90
1 file changed
codespeed/admin_views.py
@@ -158,13 +158,13 @@ def download_db(request):
158
try:
159
_build_sqlite(path)
160
f = open(path, 'rb')
161
- os.unlink(path) # unlink now; data survives until f is closed
162
today = datetime.today().strftime('%Y-%m-%d')
163
response = FileResponse(
164
f,
165
as_attachment=True,
166
filename=f'codespeed-{today}.sqlite3',
167
)
+ os.unlink(path) # unlink after FileResponse reads the file size
168
response.set_cookie(
169
'codespeed_download_ready', '1',
170
max_age=60, path='/', samesite='Lax',
0 commit comments