Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

duration work for sum second #31

Open
RezaErfani67 opened this issue Mar 7, 2022 · 0 comments
Open

duration work for sum second #31

RezaErfani67 opened this issue Mar 7, 2022 · 0 comments

Comments

@RezaErfani67
Copy link

 let cache=await apicache.has('stream'+req.params.id+req.params.slug);
        console.log(cache)
    if (cache) {
        console.log(777);

        let cache = await apicache.get('stream'+req.params.id+req.params.slug);
        const { Readable } = require('stream'); 
        const readable = new Readable()
        // readable._read = () => {} // _read is required but you can noop it
        readable.push(cache)
        readable.push(null);
        console.log(888);
        readable.pipe(res);
        readable.end();
        
        // return streamify([...bodyparts, os.EOL]).pipe(res);
        // chunks.pipe(res);


      }

 if(isBuy == true){ await apicache.set('stream'+req.params.id+req.params.slug, body,'1 day'); }
            else if(storeEpisode.type.includes('free')){ 
                await apicache.set('stream'+req.params.id+req.params.slug,body,'1 day'); 
            }
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant