mirror of
https://github.com/ddworken/hishtory.git
synced 2025-06-20 20:07:52 +02:00
Merge branch 'master' of github.com:ddworken/hishtory
This commit is contained in:
commit
24750066a7
@ -328,11 +328,13 @@ func (db *DB) GenerateAndStoreActiveUserStats(ctx context.Context) error {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
totalNumDevices, err := extractInt64FromRow(db.WithContext(ctx).Raw("SELECT COUNT(DISTINCT devices.device_id) FROM devices").Row())
|
// TODO: Update usage_data queries to reference is_integration_test_device
|
||||||
|
|
||||||
|
totalNumDevices, err := extractInt64FromRow(db.WithContext(ctx).Raw("SELECT COUNT(DISTINCT devices.device_id) FROM devices WHERE NOT is_integration_test_device").Row())
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
totalNumUsers, err := extractInt64FromRow(db.WithContext(ctx).Raw("SELECT COUNT(DISTINCT devices.user_id) FROM devices").Row())
|
totalNumUsers, err := extractInt64FromRow(db.WithContext(ctx).Raw("SELECT COUNT(DISTINCT devices.user_id) FROM devices WHERE NOT is_integration_test_device").Row())
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
@ -352,7 +354,7 @@ func (db *DB) GenerateAndStoreActiveUserStats(ctx context.Context) error {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
dailyInstalls, err := extractInt64FromRow(db.WithContext(ctx).Raw("SELECT count(distinct device_id) FROM devices WHERE registration_date > (now()::date-1)::timestamp").Row())
|
dailyInstalls, err := extractInt64FromRow(db.WithContext(ctx).Raw("SELECT count(distinct device_id) FROM devices WHERE registration_date > (now()::date-1)::timestamp AND NOT is_integration_test_device").Row())
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
@ -91,6 +91,7 @@ func (s *Server) apiBootstrapHandler(w http.ResponseWriter, r *http.Request) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TODO: Update this to take into account the source of the query
|
||||||
func (s *Server) apiQueryHandler(w http.ResponseWriter, r *http.Request) {
|
func (s *Server) apiQueryHandler(w http.ResponseWriter, r *http.Request) {
|
||||||
ctx := r.Context()
|
ctx := r.Context()
|
||||||
userId := getRequiredQueryParam(r, "user_id")
|
userId := getRequiredQueryParam(r, "user_id")
|
||||||
|
@ -104,6 +104,7 @@ func OpenDB() (*database.DB, error) {
|
|||||||
|
|
||||||
var CRON_COUNTER = 0
|
var CRON_COUNTER = 0
|
||||||
|
|
||||||
|
// TODO: Update this to delete entries from integration tests
|
||||||
func cron(ctx context.Context, db *database.DB, stats *statsd.Client) error {
|
func cron(ctx context.Context, db *database.DB, stats *statsd.Client) error {
|
||||||
// Determine the latest released version of hishtory to serve via the /api/v1/download
|
// Determine the latest released version of hishtory to serve via the /api/v1/download
|
||||||
// endpoint for hishtory updates.
|
// endpoint for hishtory updates.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user