// VocabularyGet refreshes the vocabulary cache if necessary and returns it.
VocabularyGet refreshes the vocabulary cache if necessary and returns it.
// VocabularyGet refreshes the vocabulary cache if necessary and returns it .
func (conn *Conn) VocabularyGet(ctx context.Context) (arvados.Vocabulary, error) {
	if conn.cluster.API.VocabularyPath == "" {
		return arvados.Vocabulary{
			Tags: map[string]arvados.VocabularyTag{},
		}, nil
	}
	logger := ctxlog.FromContext(ctx)
	if conn.vocabularyCache == nil {
		err := conn.loadVocabularyFile()
		if err != nil {
			logger.WithError(err).Error("error loading vocabulary file")
			return arvados.Vocabulary{}, err
		}
	}
	err := conn.maybeRefreshVocabularyCache(logger)
	if err != nil {
		logger.WithError(err).Error("error reloading vocabulary file - ignoring")
	}
	return *conn.vocabularyCache, nil
}
func ( conn * Conn ) VocabularyGet ( ctx context . Context ) ( arvados . Vocabulary , error ) { if conn . cluster . API . VocabularyPath == " " { return arvados . Vocabulary { Tags : map [ string ] arvados . VocabularyTag { } , } , nil } logger := ctxlog . FromContext ( ctx ) if conn . vocabularyCache == nil { err := conn . loadVocabularyFile ( ) if err != nil { logger . WithError ( err ) . Error ( " " ) return arvados . Vocabulary { } , err } } err := conn . maybeRefreshVocabularyCache ( logger ) if err != nil { logger . WithError ( err ) . Error ( " " ) } return * conn . vocabularyCache , nil }
VocabularyGet refreshes the vocabulary cache if necessary and returns it.
VocabularyGet refreshes the vocabulary cache if necessary and returns it .
// Initial load of vocabulary file.