diff options
| author | franck cuny <franck@lumberjaph.net> | 2011-06-18 13:42:29 +0200 |
|---|---|---|
| committer | franck cuny <franck@lumberjaph.net> | 2011-06-18 13:42:29 +0200 |
| commit | 303478552e12d9716efc033bb0f8b0a5e2e092bc (patch) | |
| tree | 64c55456d67d15cd9477e3206a9a9907abfbfd85 | |
| parent | add redis to configuration (diff) | |
| download | stargit-303478552e12d9716efc033bb0f8b0a5e2e092bc.tar.gz | |
fix cache
Signed-off-by: franck cuny <franck@lumberjaph.net>
| -rw-r--r-- | lib/StarGit.pm | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/StarGit.pm b/lib/StarGit.pm index 498646a..dc74366 100644 --- a/lib/StarGit.pm +++ b/lib/StarGit.pm @@ -17,7 +17,7 @@ get '/graph/local/:name' => sub { if (my $cached_graph = redis->get($name)){ debug("cache hit for $name"); - return $name; + return $cached_graph; } my $graph = @@ -29,7 +29,7 @@ get '/graph/local/:name' => sub { $graph->neighbors( $name, 1 ); $graph->remove_leaves(); - my $serialized_graph = _finalize($graph); + my $serialized_graph = to_json(_finalize($graph)); redis->set($name, $serialized_graph); return $serialized_graph; }; |
