Skip to content

Commit

Permalink
Fix batch_cids_exist endpoint on CN (#1330)
Browse files Browse the repository at this point in the history
* Add script to get all user clock values

* Batch requests to get CID propogation

* Make changes to creator node to batch ipfs checks

* Make the script faster (?)

* Remove semicolons and format code

* Check for file existence

* Check for cover and profile photos

* Check for existence

* Handle errors better and reduce timeouts

* Have more readable json output

* Address PR comments:
* Get total number of users and tracks
* Change default discovery URL
* Rename variables for clarity

* Add Req Limiter

* Address most PR comments

* Fix config val error

* Fix CID script

* Move await out

* Delete script

* Address PR comments:
* check if cids exists
* Use let instead of const
* Use raw: true to make it more performant

* Keep support for dir going forward

* Change limit to 1000

* Name the variable better

* Fix docstring error

* Update limits on requests

* Fix for endpoint
  • Loading branch information
cheran-senthil committed Mar 20, 2021
1 parent c120330 commit e3f5fb1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion creator-node/src/routes/files.js
Original file line number Diff line number Diff line change
Expand Up @@ -522,7 +522,7 @@ module.exports = function (app) {
for (let i = 0; i < queryResults.length; i += BATCH_CID_EXISTS_CONCURRENCY_LIMIT) {
const batch = queryResults.slice(i, i + BATCH_CID_EXISTS_CONCURRENCY_LIMIT)
const exists = await Promise.all(batch.map(
(storagePath) => fs.pathExists(storagePath)
({ storagePath }) => fs.pathExists(storagePath)
))
batch.map(({ multihash }, idx) => {
cidExists[multihash] = exists[idx]
Expand Down

0 comments on commit e3f5fb1

Please sign in to comment.