func checkExistingEntity(url string, e *Entity) error {
	err := Find(e, bson.M{"url": url}).One(&e)

	exp := e.CreatedAt.Add(ExpirationTime)

	// update the entity and re-download / parse assets
	if time.Now().After(exp) {
		err = Update(e, bson.M{"uuid": e.UUID},
			bson.M{"$set": bson.M{"aws_link": "", "status": ParsingStatus, "created_at": time.Now()}})
		if err != nil {
			log.Println("Error updating entity: ", err)
		}

		go ExtractData(e, url)
	}

	return err
}
// See if this URL has already been saved into the
// database and isn't expired - if so, return it.
See if this URL has already been saved into the
database and isn't expired - if so, return it.
// See if this URL has already been saved into the // database and isn ' t expired - if so return it .
func checkExistingEntity(url string, e *Entity) error {
	err := Find(e, bson.M{"url": url}).One(&e)
	exp := e.CreatedAt.Add(ExpirationTime)
	if time.Now().After(exp) {
		err = Update(e, bson.M{"uuid": e.UUID},
			bson.M{"$set": bson.M{"aws_link": "", "status": ParsingStatus, "created_at": time.Now()}})
		if err != nil {
			log.Println("Error updating entity: ", err)
		}
		go ExtractData(e, url)
	}
	return err
}
func checkExistingEntity ( url string , e * Entity ) error { err := Find ( e , bson . M { " " : url } ) . One ( & e ) exp := e . CreatedAt . Add ( ExpirationTime ) if time . Now ( ) . After ( exp ) { err = Update ( e , bson . M { " " : e . UUID } , bson . M { " " : bson . M { " " : " " , " " : ParsingStatus , " " : time . Now ( ) } } ) if err != nil { log . Println ( " " , err ) } go ExtractData ( e , url ) } return err }
See if this URL has already been saved into the
database and isn't expired - if so, return it.
See if this URL has already been saved into the database and isn ' t expired - if so return it .
// update the entity and re-download / parse assets