Skip to content

Commit adf9f95

Browse files
committed
Merge branch 'develop'
2 parents 66ef370 + b465f2d commit adf9f95

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

README.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Cortex
22

3+
[![Build Status](https://travis-ci.com/cbdr/cortex.svg?token=sAtZ4frpstZnGHoeyxTz&branch=master)](https://travis-ci.com/cbdr/cortex)
4+
[![Code Climate](https://codeclimate.com/repos/53f62c2869568018180036c9/badges/78e3c3c865b118bbd72b/gpa.svg)](https://codeclimate.com/repos/53f62c2869568018180036c9/feed)
5+
[![Test Coverage](https://codeclimate.com/repos/53f62c2869568018180036c9/badges/78e3c3c865b118bbd72b/coverage.svg)](https://codeclimate.com/repos/53f62c2869568018180036c9/coverage)
6+
37
## Table of Contents
48

59
- [What is Cortex?](#what-is-cortex)
@@ -151,12 +155,13 @@ bundle exec rake db:create:all
151155
$ bundle exec rake db:schema:load
152156
```
153157

154-
* Seed database with a top-level tenant, the superuser, Advice & Resources categories, and ONET occupation/industry codes:
158+
* Seed database with a top-level tenant, the superuser, Advice & Resources categories, and ONET occupation/industry codes, then rebuild the ElasticSearch index:
155159

156160
```sh
157161
$ bundle exec rake db:seed
158162
$ bundle exec rake cortex:create_categories
159163
$ bundle exec rake cortex:onet:fetch_and_provision
164+
$ bundle exec rake cortex:rebuild_indexes
160165
```
161166

162167
### Server

app/api/v1/resources/posts.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ class Posts < Grape::API
3737
params_hash = Digest::MD5.hexdigest(declared(params).to_s)
3838
cache_key = "feed-#{last_updated_at}-#{current_tenant.id}-#{params_hash}"
3939

40-
posts_page = ::Rails.cache.fetch(cache_key, expires_in: 30.minutes) do
40+
posts_page = ::Rails.cache.fetch(cache_key, expires_in: 30.minutes, race_condition_ttl: 10) do
4141
posts = ::GetPosts.call(params: declared(clean_params(params), include_missing: false), tenant: current_tenant, published: true).posts
4242
::V1::Entities::Post.represent set_paginate_headers(posts)
4343
end

0 commit comments

Comments
 (0)