[SERVER-12482] TTL using microseconds won't work anymore Created: 25/Jan/14 Updated: 10/Dec/14 Resolved: 29/Jan/14 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | None |
| Affects Version/s: | 2.4.9 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Alessio Periloso | Assignee: | Bernie Hackett |
| Resolution: | Cannot Reproduce | Votes: | 0 |
| Labels: | expireAfterSeconds, ttl | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Environment: |
Debian 6.0.8 |
||
| Operating System: | Linux |
| Steps To Reproduce: | mongo: , { expireAfterSeconds: 0 }) using pymongo: toBeCached = {'url': link, 'code': code, 'headers': headers, 'content': content, 'expireAt': expires}pages.insert(toBeCached) |
| Participants: |
| Description |
|
Setting the content to expire at a certain date with microseconds causes the expiration not to happen. Cheers from Italy! |
| Comments |
| Comment by Bernie Hackett [ 29/Jan/14 ] | ||||||||||||||||||||
|
Glad it's working for you. Let us know if you run into any issues. | ||||||||||||||||||||
| Comment by Alessio Periloso [ 29/Jan/14 ] | ||||||||||||||||||||
|
For some circumstances, when I did try to set the time to utc before it didn't work; however I've tried your hint and it does work now. Kind regards, | ||||||||||||||||||||
| Comment by Bernie Hackett [ 28/Jan/14 ] | ||||||||||||||||||||
|
bigalex, I can't reproduce this. Following the example here: http://docs.mongodb.org/manual/tutorial/expire-data/#expire-documents-at-a-certain-clock-time PyMongo:
The problem might be that you used datetime.datetime.now(). MongoDB expects UTC aware timestamps. See this PyMongo FAQ entry: |