                 contentCell.contentView.backgroundColor = Color(hexString: "1e1e1f")
             }
             
-            if site.updateNow {
+            if site.updateNow && date.timeIntervalSinceNow < TimeInterval.FourMinutes.inThePast {
                 refreshDataFor(site, index: indexPath.row)
             }
             

                return
            }
            SitesDataSource.sharedInstance.updateSite(updatedSite)
            //self.sites = SitesDataSource.sharedInstance.sites
            
            DispatchQueue.main.async {
                self.tableView.reloadData()
            }
        }
    }
    
    func openApp(with indexPath: IndexPath) {

    func updateData(){
        // Do not allow refreshing to happen if there is no data in the sites array.
        if sites.isEmpty == false {
            
            for (index, site) in sites.enumerated() {
                if site.updateNow && date.timeIntervalSinceNow < TimeInterval.FourMinutes.inThePast {
                    refreshDataFor(site, index: index)
                }
            }
        }
    }
