Skip to content

Commit

Permalink
Add support to dynamically set INDEX_META_PATH
Browse files Browse the repository at this point in the history
  • Loading branch information
Cyclonecode committed Nov 30, 2018
1 parent c7fcd12 commit 97cedae
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
7 changes: 7 additions & 0 deletions README.md
Expand Up @@ -137,6 +137,13 @@ This command will execute full reindex at first call - and then will be storing

Please note: Magento2 has a bug with altering `updated_at` field. Please install [a fix for that](https://github.com/codepeak/magento2-productfix) before using this method:

If you have a multistore setup and would like to use the delta indexer for each storeview you can not use the delta timestamp from `.lastIndex.json` for all stores; instead
you will need to set the `INDEX_META_PATH` to a unique value for each store you are indexing. For instance:

```
export INDEX_META_PATH=.lastIndex-UK.json && node --harmony cli.js productsdelta --partitions=1
```

```bash
composer require codepeak/magento2-productfix
php bin/magento cache:flush
Expand Down
2 changes: 1 addition & 1 deletion src/cli.js
Expand Up @@ -9,7 +9,7 @@ let config = require('./config');
let logger = require('./log');
let factory = new AdapterFactory(config);
const jsonFile = require('jsonfile')
const INDEX_META_PATH = '.lastIndex.json'
const INDEX_META_PATH = process.env.INDEX_META_PATH ? process.env.INDEX_META_PATH : '.lastIndex.json'

let kue = require('kue');
let queue = kue.createQueue(Object.assign(config.kue, { redis: config.redis }));
Expand Down

0 comments on commit 97cedae

Please sign in to comment.