mercredi 16 novembre 2016

Laravel Clockwork middleware dumps a ~120kb json into laravel_app/storage/clockwork on every request (196946 files and counting)

I wouldn't rise this ticket but yesterday by accident I saw that my storage/clockwork contains (fasten your seat belt):

19,490,265,152 bytes (19.92 GB on disk) for 196,946 items

Almost 197k of JSON files.

drwxr-xr-x  11 matthew  staff   374B 17 Nov 09:30 .
drwxr-xr-x   8 matthew  staff   272B 16 Nov 16:35 ..
-rw-r--r--   1 matthew  staff     7B 22 Feb  2016 .gitignore
-rw-r--r--   1 matthew  staff   109K 16 Nov 16:41 1479278489.8054.916823584.json
-rw-r--r--   1 matthew  staff   126K 16 Nov 16:41 1479278491.0863.854264907.json
-rw-r--r--   1 matthew  staff   126K 16 Nov 16:45 1479278731.1254.1964585753.json
-rw-r--r--   1 matthew  staff   126K 16 Nov 16:49 1479278959.9298.732557005.json
-rw-r--r--   1 matthew  staff   109K 17 Nov 09:28 1479338888.0561.518691365.json
-rw-r--r--   1 matthew  staff   126K 17 Nov 09:28 1479338889.3253.2010023624.json
-rw-r--r--   1 matthew  staff   109K 17 Nov 09:30 1479339012.8483.682005478.json
-rw-r--r--   1 matthew  staff   126K 17 Nov 09:30 1479339014.0917.223972419.json

The problem can be solved temporarily by calling php artisan clockwork:clean. It does clean that junk but once I will refresh the page, new JSON is being created.

Another solution is to comment the Clockwork middleware in Kernel.php

public function __construct(Application $app, Router $router)
{
    if (env('APP_ENV', 'production') === 'local') {
        // $this->prependMiddleware('Clockwork\Support\Laravel\ClockworkMiddleware'); // <--- this
    }

    parent::__construct($app, $router);
}

but that's not the way how I would like to deal with that issue. In terms of the content of those files, it looks like a dump of request, db queries etc. I assume it's useful when using Clockwork in Chrome Dev Tools to preview queries or that sort of things but shouldn't this directory be auto cleaned etc.?



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire