diff options
author | Matthew Somerville <matthew-github@dracos.co.uk> | 2017-03-15 13:57:05 +0000 |
---|---|---|
committer | Matthew Somerville <matthew-github@dracos.co.uk> | 2017-03-15 13:57:05 +0000 |
commit | 7c62e5da36f84b156dbbce331da7ca3f7961f27f (patch) | |
tree | 8bf57268431b3db5cc300dd59102a80b3244a2c6 /perllib/FixMyStreet/App/Model | |
parent | 86414debecd82fb66a03dc360944afc3ae4be3d6 (diff) |
Do upload_dir check on start up, not each report.
If we're chugging through a list of reports, this save on a lot of
pointless statting of the upload directory which we know is there.
Diffstat (limited to 'perllib/FixMyStreet/App/Model')
-rw-r--r-- | perllib/FixMyStreet/App/Model/PhotoSet.pm | 9 |
1 files changed, 1 insertions, 8 deletions
diff --git a/perllib/FixMyStreet/App/Model/PhotoSet.pm b/perllib/FixMyStreet/App/Model/PhotoSet.pm index 04521b5ce..8fcc1700e 100644 --- a/perllib/FixMyStreet/App/Model/PhotoSet.pm +++ b/perllib/FixMyStreet/App/Model/PhotoSet.pm @@ -67,14 +67,7 @@ has upload_dir => ( is => 'ro', lazy => 1, default => sub { - my $self = shift; - my $cache_dir = path(FixMyStreet->config('UPLOAD_DIR'))->absolute(FixMyStreet->path_to()); - $cache_dir->mkpath; - unless ( -d $cache_dir && -w $cache_dir ) { - warn "Can't find/write to photo cache directory '$cache_dir'"; - return; - } - $cache_dir; + path(FixMyStreet->config('UPLOAD_DIR'))->absolute(FixMyStreet->path_to()); }, ); |