You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@whimsical.apache.org by se...@apache.org on 2017/05/14 14:14:43 UTC
[whimsy] branch master updated: Allow for failure to create cache;
change location
This is an automated email from the ASF dual-hosted git repository.
sebb pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/whimsy.git
The following commit(s) were added to refs/heads/master by this push:
new 45c5cae Allow for failure to create cache; change location
45c5cae is described below
commit 45c5cae4bb1f2d5ee561fb0294790055f324554c
Author: Sebb <se...@apache.org>
AuthorDate: Sun May 14 15:14:41 2017 +0100
Allow for failure to create cache; change location
---
tools/site-scan.rb | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/tools/site-scan.rb b/tools/site-scan.rb
index d3dacc0..369ae67 100755
--- a/tools/site-scan.rb
+++ b/tools/site-scan.rb
@@ -20,11 +20,15 @@ class Cache
attr_accessor :minage
attr_accessor :enabled
- def initialize(dir: '.cache', minage: 3600, enabled: true)
+ def initialize(dir: '/tmp/site-scan-cache', minage: 3600, enabled: true)
@dir = dir
@enabled = enabled
@minage = minage
- FileUtils.mkdir_p dir
+ begin
+ FileUtils.mkdir_p dir
+ rescue
+ @enabled = false
+ end
end
def get(id, url)
--
To stop receiving notification emails like this one, please contact
['"commits@whimsical.apache.org" <co...@whimsical.apache.org>'].