mirror of
				https://github.com/tormachris/cf-workers-status-page.git
				synced 2025-11-04 12:56:24 +01:00 
			
		
		
		
	PoP location detection
This commit is contained in:
		@@ -64,10 +64,11 @@ export async function processCronTrigger(event) {
 | 
				
			|||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  // save last check timestamp including PoP location
 | 
					  // save last check timestamp including PoP location
 | 
				
			||||||
  const res = await fetch("https://www.cloudflare.com/cdn-cgi/trace")
 | 
					  const res = await fetch('https://cloudflare-dns.com/dns-query', {
 | 
				
			||||||
  const resText = await res.text()
 | 
					    method: 'OPTIONS',
 | 
				
			||||||
  const loc = /loc=([\w]{2})/.exec(resText)[1]
 | 
					  })
 | 
				
			||||||
  await setKV('lastUpdate', Date.now(), {loc})
 | 
					  const loc = res.headers.get('cf-ray').split('-')[1]
 | 
				
			||||||
 | 
					  await setKV('lastUpdate', Date.now(), { loc })
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  // gc monitor statuses
 | 
					  // gc monitor statuses
 | 
				
			||||||
  event.waitUntil(gcMonitors(config))
 | 
					  event.waitUntil(gcMonitors(config))
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user