jazzband/django-silk

Saving to Request.prof_file raises DataError for paths longer than 251 characters

開放

#201 建立於 2017年7月31日

 (4 則留言) (0 個反應) (0 位負責人)Python (319 個分叉)batch import
help wanted

倉庫指標

星標
 (3,958 顆星)
PR 合併指標
 (平均合併 4小時 49分鐘) (30 天內合併 1 個 PR)

描述

The decorator is raising a DataError when it tries to store the path of a .prof for any path greater than 251 characters, since the Request.prof_file is 100 300 characters by default, and the filename itself is 41 or 49 characters.

django.db.utils.DataError: value too long for type character varying(300)

In my case, the project path for local development was more than 60 characters at a time the column was 100 chars, which meant the file was saving to disk, but no profile data was being saved to the database. We probably want to at least save the other profile data and log an error, otherwise a long file path breaks profiling altogether.

貢獻者指南