laravel / lumen-framework

The Laravel Lumen Framework.
https://lumen.laravel.com
MIT License
1.48k stars 419 forks source link

Using database cache with locks - Call to undefined function Illuminate\Cache\now() #1107

Closed Justas-S closed 4 years ago

Justas-S commented 4 years ago

Description:

The DatabaseLock references the now() helper which is defined in Laraavel foundation. Lumen does not have access to this component.

Steps To Reproduce:

  1. Set your cache provider to database
  2. Try to acquire a lock. For example by calling Cache::lock('example')->get(function () {});
GrahamCampbell commented 4 years ago

I think we should just replace all occurrences of now with the body of that method.

driesvints commented 4 years ago

https://github.com/laravel/framework/pull/34262

driesvints commented 4 years ago

Fixed in framework. Will be tagged soon.