isage / lua-resty-moongoo

MongoDB library for OpenResty
Do What The F*ck You Want To Public License
117 stars 33 forks source link

should I close file after slurping from GridFS? #15

Closed jetz closed 6 years ago

jetz commented 6 years ago

Hi @isage:

The readme doc has told when create file in GridFS, close should be called, that's clear.

But usually we also close a file after opening for reading. so, should I close file after slurping from GridFS, I try it, but raise error (file.lua 150 line, nil value).

isage commented 6 years ago

No, you shouldn't. close is just for writing: as it's said in docs, it just writes metadata and last chunk. I guess i should've called it finalize, to avoid confusion.

jetz commented 6 years ago

@isage Got it! thanks for your quick reply.