tasks

package
v1.35.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 24, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var CohereIds = delay.Func("cohere-ids", func(ctx context.Context, id *analyticsidentifier.AnalyticsIdentifier) {
	db := datastore.New(ctx)

	id.Init(db)

	db.RunInTransaction(func(db *datastore.Datastore) error {
		ids := make([]*analyticsidentifier.AnalyticsIdentifier, 0)
		if _, err := analyticsidentifier.Query(db).Filter("UUId=", id.UUId).GetAll(&ids); err != nil {
			log.Error("Failed trying to find AnalyticsIdentifier with UUId %v", id.UUId, ctx)
			return err
		}

		userIdUpdates := id.UserId != ""

		newGAId := true
		newFBId := true

		for _, id2 := range ids {
			if id.GAId == id2.GAId {
				newGAId = false
				break
			}
		}

		for _, id2 := range ids {
			if id.FBId == id2.FBId {
				newFBId = false
				break
			}
		}

		if userIdUpdates {
			for _, id2 := range ids {
				if id.UserId == id2.UserId {
					continue
				}

				id2.Init(db)

				id2.UserId = id.UserId
				id2.Update()
			}
		}

		if newGAId || newFBId {
			id.Create()
		}

		return nil
	}, nil)
})

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL