Ignore old events
This commit is contained in:
		
							parent
							
								
									93eaa61e1e
								
							
						
					
					
						commit
						6a94abbc10
					
				
					 1 changed files with 6 additions and 0 deletions
				
			
		| 
						 | 
				
			
			@ -183,6 +183,12 @@ impl SqliteDb {
 | 
			
		|||
 | 
			
		||||
        let message = format!("[\"OK\", \"{}\", true, \"\"]", id.clone());
 | 
			
		||||
 | 
			
		||||
        // Skip events that are older than 10 minutes
 | 
			
		||||
        if chrono::Utc::now().timestamp() - 600 > created_at {
 | 
			
		||||
            let message = format!("[\"OK\", \"{}\", false, \"invalid: event creation date is too far off from the current time\"]", id.clone());
 | 
			
		||||
            return Ok(message);
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        if event.is_ephemeral() {
 | 
			
		||||
            return Ok(message);
 | 
			
		||||
        }
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue