* Check to see if a Document is already stored in redis. * @param {string} filename * @returns {Promise }
(filename)
| 107 | * @returns {Promise<boolean>} |
| 108 | */ |
| 109 | async documentIsProcessed(filename) { |
| 110 | const value = await this.docsClient.get(filename); |
| 111 | if (value) { |
| 112 | console.log(`${filename} already added to index.`); |
| 113 | return true; |
| 114 | } |
| 115 | if (value === '') { |
| 116 | console.log(`${filename} was already checked, and contains no text.`); |
| 117 | return true; |
| 118 | } |
| 119 | return false; |
| 120 | } |
| 121 | |
| 122 | /** |
| 123 | * Updates a given doc to have no text in redis. |