INNER CODE UNIT · Python
main
KiranGershenfeld/VisualizingTwitchCommunities · AtlasGeneration/Python/Main.py:18
def main():
#Calculate overlaps of all channels marked as top stream
if RECALC_OVERLAPS:
start_time = datetime.date.today()
end_time = start_time - datetime.timedelta(days=30)
OM = OverlapsManager(start_time=start_time, end_time=end_time, db_url=os.environ.get("DB_URL"))
OM.run()
OM.dump_overlaps_to_db()
#Get newest batch_id
engine = sql.create_engine(os.environ.get("DB_URL"))
metadata_obj = sql.MetaData()
overlaps_table = sql.Table("channel_overlaps", metadata_obj, autoload_with=engine)
stmt = sql.select(func.max(overlaps_table.c.batch_id))