func finalizeEntity(entity *Entity, doc *html.Node, entDir string) {
	log.Println("Entity tmp directory: ", entDir)

	var finalHTML bytes.Buffer
	bl := html.Render(&finalHTML, doc)
	if bl != nil {
		log.Println(bl)
	}

	err := StoreHTML(finalHTML, entDir)
	if err != nil {
		log.Println("Error in StoreHTML: ", err)
	}

	zipName, err := ArchiveFinalFiles(entDir)
	if err != nil {
		log.Println("Error archiving files: ", err)
	}

	err = Update(entity, bson.M{"uuid": entity.UUID}, bson.M{"$set": bson.M{"status": UploadingStatus}})
	if err != nil {
		log.Println("Error updating entity: ", err)
	}

	awsLink, err := UploadEntity(zipName, entity)
	if err != nil {
		log.Println("Error uploading final files: ", err)
	}

	err = Update(entity, bson.M{"uuid": entity.UUID}, bson.M{"$set": bson.M{"aws_link": awsLink, "status": CompleteStatus}})
	if err != nil {
		log.Println("Error updating entity: ", err)
	}
}
// Archive / upload final entity HTML
Archive / upload final entity HTML
// Archive / upload final entity HTML
func finalizeEntity(entity *Entity, doc *html.Node, entDir string) {
	log.Println("Entity tmp directory: ", entDir)
	var finalHTML bytes.Buffer
	bl := html.Render(&finalHTML, doc)
	if bl != nil {
		log.Println(bl)
	}
	err := StoreHTML(finalHTML, entDir)
	if err != nil {
		log.Println("Error in StoreHTML: ", err)
	}
	zipName, err := ArchiveFinalFiles(entDir)
	if err != nil {
		log.Println("Error archiving files: ", err)
	}
	err = Update(entity, bson.M{"uuid": entity.UUID}, bson.M{"$set": bson.M{"status": UploadingStatus}})
	if err != nil {
		log.Println("Error updating entity: ", err)
	}
	awsLink, err := UploadEntity(zipName, entity)
	if err != nil {
		log.Println("Error uploading final files: ", err)
	}
	err = Update(entity, bson.M{"uuid": entity.UUID}, bson.M{"$set": bson.M{"aws_link": awsLink, "status": CompleteStatus}})
	if err != nil {
		log.Println("Error updating entity: ", err)
	}
}
func finalizeEntity ( entity * Entity , doc * html . Node , entDir string ) { log . Println ( " " , entDir ) var finalHTML bytes . Buffer bl := html . Render ( & finalHTML , doc ) if bl != nil { log . Println ( bl ) } err := StoreHTML ( finalHTML , entDir ) if err != nil { log . Println ( " " , err ) } zipName , err := ArchiveFinalFiles ( entDir ) if err != nil { log . Println ( " " , err ) } err = Update ( entity , bson . M { " " : entity . UUID } , bson . M { " " : bson . M { " " : UploadingStatus } } ) if err != nil { log . Println ( " " , err ) } awsLink , err := UploadEntity ( zipName , entity ) if err != nil { log . Println ( " " , err ) } err = Update ( entity , bson . M { " " : entity . UUID } , bson . M { " " : bson . M { " " : awsLink , " " : CompleteStatus } } ) if err != nil { log . Println ( " " , err ) } }
Archive / upload final entity HTML
Archive / upload final entity HTML