Skip to content
This repository has been archived by the owner on Jun 5, 2024. It is now read-only.

Commit

Permalink
Merge pull request #94 from lukeromanowicz/release/v1.10
Browse files Browse the repository at this point in the history
Release v1.10
  • Loading branch information
lukeromanowicz committed Jul 10, 2019
2 parents dcc86d0 + 426648c commit 51f3b20
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 7 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ src/test_reindex.sh
src/node_modules
package-lock.json
node_modules
.idea
12 changes: 10 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,16 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

<<<<<<< HEAD
## [1.9]
# [1.10] - 2019.07.10
### Added
- Added optional Redis Auth functionality. - @rain2o (#42)
- MSI support - @dimasch (#86)

### Fixed
- Import throwing an error when product's first category name was empty - @Loac-fr (#92)
- Typos in documentation - @kkdg, @adityasharma7 (#90, #91)

## [1.9] - 2019.03.14
### Added
- New ENV variable `SEO_USE_URL_DISPATCHER` (default = true) added. When set, then the `product.url_path` and `category.url_path` are automatically populated for the UrlDispatche featu$

Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,8 @@ node --harmony cli.js productsworker
```

**Please note:** We're using [kue based on Redis queue](https://github.com/Automattic/kue) which may be configured via `src/config.js` - `kue` + `redis` section.
**Please note:** There is no authorization mechanism in place for the webapi calls. Please keep it local / private networked or add some kind of authorization as a PR to this project please :-)

**Please note:** Redis now supports auth. In order to use Redis with auth simply pass the password to the `REDIS_AUTH` env variable.


### Multistore setup
Expand Down
6 changes: 5 additions & 1 deletion src/adapters/abstract.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,12 @@ class AbstractAdapter {
if (global.cache == null) {
this.cache = Redis.createClient(this.config.redis); // redis client
this.cache.on('error', (err) => { // workaround for https://github.com/NodeRedis/node_redis/issues/713
global.cache = Redis.createClient(this.config.redis); // redis client
this.cache = Redis.createClient(this.config.redis); // redis client
});
// redis auth if provided
if (this.config.redis.auth) {
this.cache.auth(this.config.redis.auth);
}
global.cache = this.cache;
} else this.cache = global.cache;

Expand Down
13 changes: 10 additions & 3 deletions src/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,15 @@ module.exports = {
productUrlPathMapper: (product) => {
let destPath = ''
if (product.category && product.category.length > 0) {
const firstCat = product.category[0]
destPath = (firstCat.path ? (firstCat.path) : _slugify(firstCat.name)) + '/' + (product.slug ? product.slug : _slugify(product.name + '-' + product.id))
} else {
for (let i = 0; i < product.category.length; i++) {
if (typeof product.category[i].name !== 'undefined') {
const firstValidCat = product.category[i]
destPath = (firstValidCat.path ? (firstValidCat.path) : _slugify(firstValidCat.name)) + '/' + (product.slug ? product.slug : _slugify(product.name + '-' + product.id))
break
}
}
}
if (destPath === '') {
destPath = (product.slug ? product.slug : _slugify(product.name + '-' + product.id))
}
destPath += '.html'
Expand Down Expand Up @@ -61,6 +67,7 @@ module.exports = {
redis: {
host: process.env.REDIS_HOST || '127.0.0.1',
port: process.env.REDIS_PORT || 6379,
auth: process.env.REDIS_AUTH || false,
db: process.env.REDIS_DB || 0
},

Expand Down

0 comments on commit 51f3b20

Please sign in to comment.