Heroku: how to store a variable that mutates?

456
February 11, 2017, at 09:02 AM

I have deployed a small application to Heroku. The slug contains, among other things, a list in a textfile. I've set a scheduled job to, once an hour, run a python script that select an item from that list, and does something with that item.

The trouble is that I don't want to select the same item twice in sequence. So I need to be able to store the last-selected item somewhere. It turns out that Heroku apparently has a read-only filesystem, so I can't save this information to a temporary or permanent file.

How can I solve this problem? Can I use os.environ in python to set a configuration variable that stores the last-selected element from the list?

Rent Charter Buses Company
READ ALSO
h5py dataset can't be modified or deleted, gives “Incorrect cache entry type” error

h5py dataset can't be modified or deleted, gives “Incorrect cache entry type” error

I was trying out some multithreading with a program that writes to an HDF5 dataset made with h5pyThe program failed to terminate, and I couldn't interrupt it with CTRL + C, so I forced python to quit

454
get an element out of a string python

get an element out of a string python

I am trying to use linestrip() and line

529
Is it possible to do applymap using the groupby in pandas?

Is it possible to do applymap using the groupby in pandas?

In a pandas Dataframe I want to applymap(somefunction) using groupby (using some column index values)

781
Beautiful Soup .get_text() does not equal Python string when it should

Beautiful Soup .get_text() does not equal Python string when it should

I am using Beautiful Soup to grab text from an html element

446