Expiry time not changing

I’m stuck on Stage #(change to your stage, ex. #JM3).

I’ve tried parsing the expiry time but it doesnt update for some reason

Here are my logs:

{250: {'redis-ver': '7.2.0', 'redis-bits': ''}, 251: {'no_expiry_dict_size': 5, 'expiry_dict_size': 5}, 252: {('mango', 1956528000000, 0): 'pear', ('blueberry', 1956528000000, 0): 'pineapple', ('apple', 1956528000000, 0): 'blueberry', ('strawberry', 1640995200000, 0): 'banana', ('banana', 1956528000000, 0): 'strawberry'}, 253: {}, 254: {'db_number': 0}, 255: {'crcchecksum': '20511923824317112157238'}, 'misc_kvs': {}}
[your_program] 0 byte val curr
[your_program] curr byte header 252
[your_program] in the expiry
[your_program] 252 curr head
[your_program] In 252  b'\x00\x0c(\x8a\xc7\x01\x00\x00'
[your_program] 0
[your_program] time 1956528000000
[your_program] here for now

And here’s a snippet of my code:

if current_header_for_data == 252:
                            print("In 252 ",self.file_byte_data[self.position_in_file:self.position_in_file+8])
                            
                            time_expiry_seconds = struct.unpack('<Q', self.file_byte_data[self.position_in_file:self.position_in_file+8])[0]
                            self.position_in_file+=8
                            print(self.file_byte_data[self.position_in_file])
                            #time_expiry_seconds = int.from_bytes(time_expiry_seconds, byteorder='little', signed=False)

                            print("time", time_expiry_seconds)

Hi @shreyasganesh0, do you mind elaborating a bit on “it doesnt update”?

I changed the parsing to consider only 7 bytes but im getting the same value for expiry so I wondering if I was missing something. I did just using [self.position_in_file:self.position_in_file+8] and converting it using int.from_bytes(time_expiry_seconds, byteorder=
‘little’, signed=False)

@shreyasganesh0 Looks like you’ve got past this stage — do you happen to remember what was wrong? Would love to see if we can improve the tester / instructions.

Oh yeah its beacause it was a unixtime stamp and I handwaved it assuming the datetime packahe would take care of the conversion part.

1 Like

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.