As @oliviertoupin told me offline, the current rate is not available from TaskContext. So no need to change this code.