So, at a high level you want more than just the backgrounding the pin task, you also need to be able to tell what the progress is, periodically. This probably means we need to do something with the api endpoint output (i was initially thinking 'just throw it away and mark completion').
> in some cases, if I've pinned it at all.
What cases would those be? If the file is pinned it should always show up in an `ipfs pin ls $CID`.
In the short term, I assume your service is a server side app that is making requests to the ipfs node, right? You could set some background task in that application that just waits on the `ipfs pin add --progress` call and keeps track of the progress for that pin, that way, when a customer queries it, and its in progress, you can return that information. Agree this should be built into ipfs at this point, but that seems like a reasonable workaround for now.
> you also need to be able to tell what the progress is
That would be nice, but not really required.
> I assume your service is a server side app that is making requests to the ipfs node, right?
Yes, exactly.
> You could set some background task in that application that just waits on the `ipfs pin add --progress` call
I did that, there were problems with the fact that you can't have too many pinning calls waiting due to resource constraints. I can't just have 100k requests open and waiting, they time out, I need to restart the server, things happen. At that point, every single task needs to fire up again and make an API call to the server.
I did the same thing with batching, but then long-running pins (files not in the network) would block and new files that were on the network wouldn't work. This happens with IPFS Cluster too, I just don't have to write my own code to worry about it.
Believe me, I've spent lots of time on working around this, and the workaround can only be so good with the current system.
> in some cases, if I've pinned it at all.
What cases would those be? If the file is pinned it should always show up in an `ipfs pin ls $CID`.
In the short term, I assume your service is a server side app that is making requests to the ipfs node, right? You could set some background task in that application that just waits on the `ipfs pin add --progress` call and keeps track of the progress for that pin, that way, when a customer queries it, and its in progress, you can return that information. Agree this should be built into ipfs at this point, but that seems like a reasonable workaround for now.