The client checks the saved_images folder for text prompts for which images have already been generated. If there happens to be a Tweet prompt for which no images has been generated by the client and the server also happens to be off, the client will keep sending a request to the server for a new image and fail. Eventually, the counter for the number of screen refreshes reaches its max limit and the client's program is shut off.
This is a bug. We want the client to load images from the saved_images folder when the server is off (if there are no images, then the program should exit) even if there are new Tweet prompts.
Solution:
Only send requests for Tweet prompts to the Twitter API when the server is on, otherwise load image from saved_images
Implementation:
Check status of API endpoint for the server (in check_recent_tweets_and_generate_image_if_new?) before making a request to Twitter API
The client checks the
saved_images
folder for text prompts for which images have already been generated. If there happens to be a Tweet prompt for which no images has been generated by the client and the server also happens to be off, the client will keep sending a request to the server for a new image and fail. Eventually, the counter for the number of screen refreshes reaches its max limit and the client's program is shut off.This is a bug. We want the client to load images from the
saved_images
folder when the server is off (if there are no images, then the program should exit) even if there are new Tweet prompts.Solution:
saved_images
Implementation:
check_recent_tweets_and_generate_image_if_new
?) before making a request to Twitter API