I put together a tool that runs in the system tray and compares an attribute table column for a feature class to information pulled from a website to let me know when there's new work to be done. It works for the most part but I'm having issues with it not updating after I add new information to the table. I'm using arcpy.da.SearchCursor() in a function to retrieve the data from the table, but each time I call the function, I get the data that was retrieved on the first call, I need it to retrieve the latest data. I've tried calling the .reset() method on the object it returns, deleting the object, and calling arcpy.ResetEnvironments to no avail. The only success I have with the tool or in a python terminal is closing the tool/terminal and reopening it. Is there a way to force SearchCursor to pull new data? Maybe there's another method that I should be using? Thanks.
def get_mapped_permits():
building_permits_2022 = "path.to.sde"
mapped = [each for permit in arcpy.da.SearchCursor(building_permits_2022, "PERMIT_NUM") for each in permit]
return mapped