File tree Expand file tree Collapse file tree 1 file changed +12
-3
lines changed Expand file tree Collapse file tree 1 file changed +12
-3
lines changed Original file line number Diff line number Diff line change @@ -267,15 +267,24 @@ def project_root=(root_dir)
267
267
end
268
268
269
269
def detect_release
270
- detect_release_from_heroku ||
270
+ detect_release_from_git ||
271
271
detect_release_from_capistrano ||
272
- detect_release_from_git
272
+ detect_release_from_heroku
273
273
end
274
274
275
275
private
276
276
277
277
def detect_release_from_heroku
278
- ENV [ 'HEROKU_SLUG_COMMIT' ]
278
+ sys_dyno_info = `cat /etc/heroku/dyno` rescue nil
279
+ return unless sys_dyno_info && sys_dyno_info != ""
280
+
281
+ # being overly cautious, because if we raise an error Raven won't start
282
+ begin
283
+ hash = JSON . parse ( sys_dyno_info )
284
+ hash && hash [ "release" ] && hash [ "release" ] [ "commit" ]
285
+ rescue JSON ::JSONError
286
+ logger . error "Cannot parse Heroku JSON: #{ sys_dyno_info } "
287
+ end
279
288
end
280
289
281
290
def detect_release_from_capistrano
You can’t perform that action at this time.
0 commit comments