mirror of
https://github.com/ddworken/hishtory.git
synced 2025-08-15 01:22:43 +02:00
Periodically call query endpoint and retrieve data to ensure that the local DB is always reasonably up to date
This commit is contained in:
@ -760,13 +760,13 @@ func Reupload(ctx context.Context) error {
|
||||
})
|
||||
}
|
||||
|
||||
func RetrieveAdditionalEntriesFromRemote(ctx context.Context) error {
|
||||
func RetrieveAdditionalEntriesFromRemote(ctx context.Context, queryReason string) error {
|
||||
db := hctx.GetDb(ctx)
|
||||
config := hctx.GetConf(ctx)
|
||||
if config.IsOffline {
|
||||
return nil
|
||||
}
|
||||
respBody, err := ApiGet(ctx, "/api/v1/query?device_id="+config.DeviceId+"&user_id="+data.UserId(config.UserSecret))
|
||||
respBody, err := ApiGet(ctx, "/api/v1/query?device_id="+config.DeviceId+"&user_id="+data.UserId(config.UserSecret)+"&queryReason="+queryReason)
|
||||
if IsOfflineError(ctx, err) {
|
||||
return nil
|
||||
}
|
||||
|
Reference in New Issue
Block a user