Skip to content

Commit

Permalink
movie + playing theater now have its expiration on
Browse files Browse the repository at this point in the history
  • Loading branch information
killedbymemory committed May 9, 2012
1 parent 0f00311 commit 03960f3
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion cinema21.js
Expand Up @@ -721,7 +721,22 @@ Cinema21.prototype.movieByCity = function(movie_id, city_id) {
// get movie detail
self.movie(movie_id, function(movie){
response.movie = movie;
self.render(response);

// store result to redis, set expire, and render
console.log('try to store move detail + playing at to redis');
self.getStorageClient().set(key, JSON.stringify(response), function(err, result) {
if (err) {
console.log('unable to store movie detail and playing_at within city to redis');
}

if (result == 'OK') {
console.log('movie detail and playing_at within city successfully stored into redis');

self.expire(key, function(){
self.render(response);
});
}
});
});
});
}
Expand Down

0 comments on commit 03960f3

Please sign in to comment.