Created
February 16, 2020 05:50
-
-
Save rbotzer/9f07f15095b5a4380f99993fadbd78ad to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Fetch the user's segments that are not going to expire today | |
today = datetime.datetime(now.year, now.month, now.day) | |
end_ttl = int((today - epoch).total_seconds() / 3600) | |
print("\nGet only user segments that are not going to expire today") | |
if options.interactive: | |
pause() | |
ops = [ | |
mh.map_get_by_value_range( | |
"u", | |
[0, aerospike.null()], | |
[end_ttl, aerospike.null()], | |
aerospike.MAP_RETURN_KEY, | |
True, | |
) | |
] | |
_, _, b = client.operate(key, ops) | |
print("Show all segments not expiring today:".format(segment_ttl)) | |
print(b["u"]) | |
print(spacer) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment